Re: LoadLibrary() in eVC
From: Michael J. Salamone [eMVP] (mikesa#at#entrek#dot#com)
Date: 12/23/04
- Next message: Greg: "Double click reception on a combo box derived class."
- Previous message: Naveen Mukkelli: "LoadLibrary() in eVC"
- In reply to: Naveen Mukkelli: "LoadLibrary() in eVC"
- Next in thread: Naveen Mukkelli: "Re: LoadLibrary() in eVC"
- Reply: Naveen Mukkelli: "Re: LoadLibrary() in eVC"
- Reply: r_z_aret_at_pen_fact.com: "Re: LoadLibrary() in eVC"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Dec 2004 07:01:32 -0800
System APIs in CE take wide char, not char. Casting doesn't convert char to
wide-char, just fools the compiler.
Use TCHAR, TEXT(), etc.
For your specific problem, either LoadLibrary(TEXT("mydll.dll")) or
LoadLibrary(L"mydll.dll").
Actually, my personal philosophy (and what I practice) is to forget about
TCHAR - always use WCHAR, L"", L''. This if you're Windows
NT/XP/CE-centric. Mitigates usage of #ifdef UNICODE/#ifdef MBCS and using
WideCharToMultiByte and MultiByteToWideChar (and associated bugs that arise
when you compile it the "other" way - "other" being MBCS defined when
normally UNICODE is defined).
--
Michael Salamone [eMVP]
Entrek Software, Inc.
www.entrek.com
"Naveen Mukkelli" <NaveenMukkelli@discussions.microsoft.com> wrote in
message news:D018721E-6286-41A9-A550-66C47947D73C@microsoft.com...
> Hi,
>
> I'm trying to load a dll in my eVC application using "LoadLibrary()".
> I'm developing a dll for Pocket PC 2003 with help of another third party
> dll.
> I've downloaded the third party dll in "\Windows " directory of my PDA.
>
> When I tried
> HINSTANCE hwd = LoadLibrary("mydll.dll"), the following error is
> occurring,
> "error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'char [10]'
> to 'const unsigned short *".
>
> However, When I tried
> HINSTANCE hwd = LoadLibrary((LPCTSTR)"mydll.dll") program is compiling
> properly. But it is not loading the dll. I found that "hwd" is NULL
> after
> the method call to LoadLibrary.
>
> could any one let me know the correct way of using "LoadLibrary" please.
>
> Cheers,
>
> Naveen Mukkelli.
- Next message: Greg: "Double click reception on a combo box derived class."
- Previous message: Naveen Mukkelli: "LoadLibrary() in eVC"
- In reply to: Naveen Mukkelli: "LoadLibrary() in eVC"
- Next in thread: Naveen Mukkelli: "Re: LoadLibrary() in eVC"
- Reply: Naveen Mukkelli: "Re: LoadLibrary() in eVC"
- Reply: r_z_aret_at_pen_fact.com: "Re: LoadLibrary() in eVC"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|