Any ideas?
Ciao,
Thomas
--
Alex Feinman
---
Visit http://www.opennetcf.org
"Thomas" <krue...@tegaron.de> wrote in message
news:1120490252.5...@f14g2000cwb.googlegroups.com...
Alex Feinman [MVP] schrieb:
> Sounds like you have a mismatch in function definition between DLL and EXE.
Thanks for your answer!
That's what I thought too, but the definitions are OK. The problem
applies to every function with more than one parameter.
Also call definitions like stdcall do not work.
Regards,
Thomas
--
Alexander Shargin
Microsoft MVP in Mobile Devices
http://www.pocketpcdn.com - Pocket PC Developer Network
http://www.smartphonedn.com - Smartphone Developer Network
http://www.rsdn.ru - Russian Software Developer Network
"Thomas" <krue...@tegaron.de> ???????/???????? ? ???????? ?????????:
news:1120490252.5...@f14g2000cwb.googlegroups.com...
sorry, it looks a bit confusing but here we go...
This is part of the application:
testapp.h:
typedef void (CALLBACK* FUNC)(int parm1, int parm2, unsigned short*
str1, unsigned short* str2);
FUNC Function;
testapp.cpp:
dll = LoadLibrary(_T("TestDLL.dll"));
if (dll != NULL)
{
Function = (FUNC)GetProcAddress(dll, _T("Func"));
if (Function != NULL)
Function(7, 8, _T("str1"), _T("str2"));
}
and this is part of the DLL:
testdll.h:
__declspec(dllexport) void Func(int parm1, int parm2, unsigned short*
str1, unsigned short* str2);
testdll.cpp:
__declspec(dllexport) void Test::Func(int parm1, int parm2, unsigned
short* test1, unsigned short* test2)
{
CString str;
str.Format(_T("%d, %d, %s, %s"), parm1, parm2, test1, test2);
MessageBox(NULL, str, NULL, MB_OK);
}
and of course the definition file:
LIBRARY "TestDLL"
EXPORTS
Func
The function in the dll is currently member of a class called Test ;-)
But I tested a lot, also with a dll, which just exports a function, not
a class.
Thanks for your help!
Thomas