Re: Loading a DLL using Qt
try L"firstdll.dll" instead of "firstdll.dll" in LoadLibrary
Re: Loading a DLL using Qt
thanks mate, it worked.
what was the problem??
Re: Loading a DLL using Qt
did u try it? if i remember correctly, it would convert parameter 1 from 'const char [12]' to 'LPCWSTR'
Re: Loading a DLL using Qt
yup. I tried it and it worked.
Now i have a working program in VC++, but i need a Qt version of it, how can I do that?
Re: Loading a DLL using Qt
Re: Loading a DLL using Qt
I just thought I'd mention that you're using Win32 API calls which are windows specific.
The L prefix has something to do with treating the string as Unicode or something, again windows specific. You've probably got Unicode specified in your project settings so the IDE has picked up the unicode version of it's C++ libraries. You're quoted error states 'LoadLibraryW' as having a problem. LoadLibrary is the standard one that takes the standard char set. LoadLibraryW takes a Unicode string, so the L I believe tells the pre-processor to convert this to a unicode string. Another way too fix this error would have been to turn off Unicode under the Project properties dialog, with no need to prefix with the letter L.
I would say that if you're on QtCentre you're intention is to produce cross platform code, so use QLibrary as suggested by aamer4yu.
You can still to Qt libraries in VC++, so there's not really any need to prototype a full blown Win32 version prior to going for Qt, unless of course you're testing migration strategies of legacy windows code.
I hope this provides a little more insight into the monster what is Visual Studio.