Thanks. I certainly overlooked the #ifdefs, as the struct for both
are simultaneously defined.
with this sort of function parameter.
signature? I assume no.
"BoHuang" <BoHuang@discussions.microsoft.com> ha scritto nel messaggio
news:374A994A-BE08-484E-9B14-1640E6FBA125@microsoft.com...
I recently had to use a DLL in which this function:
protected:
virtual BOOL PreCreateWindow( CREATESTRUCT& cs );
just cannot be found by the linker.
I came across an old thread that instructs to change my project setting
from
Unicode to Multi-byte. Thereafter the linker found the function.
Why is this the case? Could it be due to the LPCSTR in CREATESTRUCT?
If you go to the Win32 SDK file <winuser.h>, you can see that there are
two
"CREATESTRUCT's": CREATESTRUCTA (for ANSI/MBCS), and CREATESTRUCTW (for
Unicode).
So, on a ANSI/MBCS build, your PreCreateWindow is actually like this:
virtual BOOL PreCreateWindow( CREATESTRUCTA & cs );
Instead on a Unicode build, CREATESTRUCTW is used:
virtual BOOL PreCreateWindow( CREATESTRUCTW & cs );
This explain the linking mismatch.
How can I know if any DLL requires this sort of fix?
In general, I would expect something like this whenever you have some
form
of string pointer (e.g. LPCTSTR).
Giovanni