acc13 wrote:
> I have written a .dll that exports a class MyClass, which has a member
> function MyFunction(LPCWSTR szMyString).
>
> If I build (I'm using VC7) with the /showIncludes option, I can see
> that LPCWSTR is defined in file ...\platformsdk\include\winnt.h as:
>
> typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR;
>
> and WCHAR is in turn defined as:
>
> #ifndef _MAC
> typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
> #else
> // some Macintosh compilers don't define wchar_t in a convenient
> location, or define it as a char
> typedef unsigned short WCHAR; // wc, 16-bit UNICODE character
> #endif
>
> I have (obviously) not defined _MAC (I even verified that no rogue
> include did so by testing "#ifdef _MAC\n#error _MAC defined!\n#endif),
> so I expect the .lib file to export the function
>
> long __thiscall MyClass::MyFunction(wchar_t const *)
>
> Instead the output from dumpbin shows that my lib file exports the
> function,
>
> long __thiscall MyClass::MyFunction(unsigned short const *)
>
> and my test dll client program builds with a LNK2019 unresolved
> external symbol.
> What's the deal?
This question should be asked on a Microsoft-specific newsgroup. See
this FAQ for what is on-topic here and for a list of other places you
could try:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.9
Cheers! --M