----- Original Message -----
From: "Simon Buchan" <simon@...>
Sent: Monday, August 02, 2010 6:20 AM
Subject: Re: [IBPP-DISCUSS] Compile IBPP in wxWidgets project
> On 2010-07-20 19:48, John Roberts wrote:
>> ----- Original Message -----
>> From: "Daniel Albuschat"<d.albuschat@...>
>> Sent: Tuesday, July 20, 2010 2:59 PM
>> Subject: Re: [IBPP-DISCUSS] Compile IBPP in wxWidgets project
>>> 2010/7/20 John Roberts<johnr@...>:
>>>> Thanks for your reply Boris. However, I am not dealing with wxString
>>>> and don't understand how wx2std() or std2wx() will help convert
>>>> from 'const char *' to 'LPCWSTR' where it is found in ibpp code.
>>>> mHandle = LoadLibrary(path.c_str());
>>>> gives compiler error
>>>> \ibpp\_ibpp.cpp(142) : error C2664: 'LoadLibraryW' : cannot convert
>>>> parameter 1 from 'const char *' to 'LPCWSTR'
>>>> Cheers, John
>>> Hi John,
>>> IBPP can (still) not be compiled with UNICODE set. There are a few
>>> minor changes that have to be made. You can, for example, change to
>>> call to LoadLibrary() to LoadLibraryA().
>>> Daniel Albuschat
>> Thanks Daniel. I thought that might be the case.
>> To stay with UNICODE I have used casts through the IBPP code as per
>> mHandle = LoadLibrary((LPCWSTR)("gds32.dll"));
>> mHandle = LoadLibrary((LPWSTR)fbdll);
>> It compiles and runs now with the limited testing I have done so far. If
>> continue to use it I will use svn to maintain my changes if they are
>> Cheers, John
> No, you don't want to do this, not only will LoadLibraryW (called when
> UNICODE is defined) not understand what you passed it, but it will no
> longer compile when LoadLibraryA is called when UNICODE is not defined.
> Explicitly calling LoadLibraryA() is the best option here unless you
> want to switch IBPP to using some definition that is either wchar_t or
> char depending on platform so you can use unicode paths.
Yes I figured that out and the latter approach is what I ended up doing.
Thanks for your help, John