Discussion:
porting Win32 to Mac TCHAR
(too old to reply)
DLPnet
2003-10-23 14:22:40 UTC
Permalink
Hello,


I m trying to port a Win32 application which use TCHAR as variable type
but it s undefined when I compile it under codewarrior. Where should I
find the correct header ?

Thanks for your help,

dlp

ps: I m using CW 8.xx
Sean McBride
2003-10-23 15:28:16 UTC
Permalink
Post by DLPnet
I m trying to port a Win32 application which use TCHAR as variable type
but it s undefined when I compile it under codewarrior. Where should I
find the correct header ?
What header is it defined in on Windows? Its not a standard C/C++ type
AFAICT.
DLPnet
2003-10-23 15:38:46 UTC
Permalink
Post by Sean McBride
Post by DLPnet
I m trying to port a Win32 application which use TCHAR as variable type
but it s undefined when I compile it under codewarrior. Where should I
find the correct header ?
What header is it defined in on Windows? Its not a standard C/C++ type
I ve found some reference in CString... maybe I should change to _TCHAR
? and include tchar.h ? (#include <tchar.h> with CW ?)

dlp
Sean McBride
2003-10-23 17:21:04 UTC
Permalink
Post by DLPnet
I ve found some reference in CString... maybe I should change to _TCHAR
? and include tchar.h ? (#include <tchar.h> with CW ?)
What's CString? There's no tchar.h on my harddrive, so I'm guessing its
a Windows-specific header. You need to change your code to not use this
type, or define the type in some way. I think you should read:

http://developer.apple.com/macosx/win32porting/
Steve
2003-10-23 18:40:53 UTC
Permalink
Post by DLPnet
Hello,
I m trying to port a Win32 application which use TCHAR as variable type
but it s undefined when I compile it under codewarrior. Where should I
find the correct header ?
Thanks for your help,
dlp
ps: I m using CW 8.xx
This is a macro defined somewhere in the bowels of the Windows headers which
eventually equates to either a char or wchar_t depending on if you are
compiling for Unicode or not. If you use TCHAR all over the place, your code
becomes (more) unicode friendly.

There maybe equivalents when compiling on the Mac, but to be honest I don't
know what they are, maybe someone else can help here?

I ported some code recently, but cheated just used char because I knew I
would never be compiling that bit of code for unicode. (Sod's law says I'll
change my mind in the future though!!!)

You also mentioned CString in your other post - are you porting an MFC app?
--
Regards,
Steve.
Loading...