Little description:I made an aplication with TTntEdit (from TntWare Delphi Unicode Controls) using Delphi 7. The TTntEdit is used for inputting the directory path. This is the piece of code to connect the TTnTEdit to the TFindFile component:

But for "ExpandUNCFileName", I couldn't find the TTnt version, so I change it with "WideExpandFileName" for temporary. I' was thinking to create the unicode version of "ExpandUNCFileName" from delphi source code, but it's too hard, the code involves some windows network API functions. Could you help me with this?

I also replaced all words of "TFindFile" to "TFindFileW". Especially in this line:

I have some questions:* The "Threaded" property of TFindFile, if I set it to true, does it make the finding process more faster?

* I found out that some delphi 7 functions from system & sysutils unit such as: Delete, Copy, StrToIntDef, etc, can accept widestring whereas the delphi 7 help doesn't mention the functions support widestring input. Could you give me explanation about this?

* The unicode text couldn't displayed correctly when I use function ShowMessage, where MessageBoxW could. The unicode char was showed as question mark, i.e. C:\???\. I saw in the delphi 7 documentation, the function showmessage has the overloaded version that accept widestring. I've already tried to type-cast the input, i.e.: Showmessage(WideString(str)), but still no avail. Do you know what's the cause?

Some functions like Delete and Copy which work on both arrays and strings works on widestrings too. Some functions like StrToInt only accepts AnsiStrings and if you pass a WideString to them, the compiler implicitly converts it to AnsiString. But the result is the same because for example Latin digits are Latin digits anyway.If any other function accepts Unicode strings, in the help mentioned that "This function works for multi-byte character systems (MBCS)".

You have to choose a font that supports Unicode characters. Characters missing in a font will be displayed as question mark.

You have to choose a font that supports Unicode characters. Characters missing in a font will be displayed as question mark.

How to choose a font?Why font in ShowMessage is different with the font in MessageBox?

If you don't mind I need your advice:I create these 2 functions to calculate file size from a file path given input. Between them, which is more faster and best to use? Do you know other best alternative for this function?

MessageBox is a Windows API but ShowMessage is a Delphi function that displays a dialog with one TLabel and TButton on it. None of the label and the button are Unicode enabled and font is the default Delphi font which is 'Ms Sans Serif'. I personally write my own ShowMessage function.

The second function seems to be faster but you don't know until you run a test.

Choosing between raising an exception or returning an error code highly depends on your coding logic. Sometime an exception is more convenient and sometimes an error code. But in case of getting file size, I prefer to return -1 on error because if GetFileSize fails too, it returns -1.

// These arrays map each character to itself for case sensitive searchAnsiCharMap: array [AnsiChar] of AnsiChar; WideCharMap: array [WideChar] of WideChar;

// These arrays map each character to its lowercase for case insensitive searchAnsiLowerCharMap: array [AnsiChar] of AnsiChar; WideLowerCharMap: array [WideChar] of WideChar;

// These arrays map alphanumeric characters to false and other characters to true, used for whole word searchAnsiIsDelimiter: array[AnsiChar] of Boolean;WideIsDelimiter: array[WideChar] of Boolean;

When a case sensitive search is requested, I pass AnsiLowerCharMap/WideLowerCharMap to the search function. Otherwise, I pass AnsiCharMap/WideCharMap to the search function. So, it doesn't matter which kind of search you choose, the search speed is the same.

The InitFastContentSearch procedure initializes the above arrays with the appropriate values once during application lifetime.

What's the purpose & benefit of using the character mapping? If I don't use character mapping, what's the common technique people use?

Some questions again:* Do you know another good unicode delphi component unit besides TntUnicodeControls? Do you use TntUnicodeControls too in your application?

I forget to tell you that I'm using TntUnicodeControls v2.3.0 (old freeware). The latest version (now shareware) might already have defined "WideExpandUNCFileName".

I'm thinking that isn't it better if FindFileW depends on a free-and-still-updated unicode library? Or maybe better if the "WideXXX" functions are written into FindFileW.pas to lessen dependency to 3rd party unit file or make a unit file to hold the unicode functions and included by FindFileW.pas.

* Do you ever use delphi 2009? Is Delphi 2009 better than Delphi 7? If so, do you think that I should switch to Delphi 2009?

It's me that should thank to you.You're very kind to lend your little time to help me.Btw, I like this smily: