Hi
I have created a DLL named firstdll.dll and its written in C. It has only 1 function, named Display(), which i am exporting. When i call that function, it returns a string.
Now my question is how can I load that dll into my c++ application, so that i can get the string and display it?
I am trying using LoadLibrary() and other such functions to load the dll but i am not able to make it work. (In C# and VB its not that tough, but since i want to use c++ and Qt, i am finding it very hard to load the dll.)
I am using this code
but i get the following errorHMODULE hDll = LoadLibrary("firstdll.dll");
FARPROC fpDisplay = GetProcAddress(hDll, "Display");
typedef char* (__stdcall *fpDisplayT)();
fpDisplayT Display = (fpDisplayT)fpDisplay;
How can i solve this error?Error 1 error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'const char [12]' to 'LPCWSTR'
It would be very helpful if you can give me the complete code to load the dll and then how to retrieve a string that dll returns when called.
thanks in advance.
Bookmarks