View Single Post
  #254  
Old 19-03-2013, 07:43
altef_4's Avatar
altef_4 altef_4 is offline
Registered User
 
Join Date: Mar 2012
Location: Ukraine
Posts: 361
Thanks: 248
Thanked 1,022 Times in 239 Posts
altef_4 is on a distinguished road
Quote:
Originally Posted by Joe Forster/STA View Post
Isn't there an automatism to select between the ANSI and Unicode versions of functions?! In a C compiler, you simply use GetDriveType - or whatever function, without a suffix in its name - and it gets automatically expanded to ...A in an ANSI and ...W in a Unicode program (in the system headers, according to whether or not the "UNICODE" symbol is defined). I see something like this at the beginning of one of the scripts above (#define A "A"/"W").

I'm actually experimenting at this moment with some dangerous C macro automatism to be able to turn an ANSI program into a Unicode program by just defining "UNICODE".
maybe i don't correctly understood you, but to auto change u/a functions you can use this code
Code:
#ifdef UNICODE
   #define A "W"
#else
   #define A "A"
#endif
[_code]
function GetDriveType(lpDisk: String): Integer; external 'GetDriveType{#A}@kernel32.dll stdcall setuponly';
Reply With Quote