Re: Cannot load 32-bit DLL "name" (Error 1753) by Olaf
Olaf
Mon Aug 07 07:24:17 CDT 2006
> in .cpp:
> long __cdecl MyDLLFunction()
> {
> }
>
> in .def:
> LIBRARY MyDll
> EXPORTS
> MyDLLFunction@1
>
> in VFP:
> DECLARE LONG MyDLLFunction IN "J:\Carol\MyDll.dll"
> ReturnCode=MyDLLFunction()
It may help to
#include <windows.h>
and define the function as
long __declspec(dllexport) MyDLLFunction()
I think DECLARE cannot handle the way you export the function as
ordinal number (MyDLLFunction@1).
And you definately need the skeleton for a DLL, a LibMain Function
of this kind:
BOOL WINAPI __declspec(dllexport) LibMain(HINSTANCE hDLLInst, DWORD
fdwReason, LPVOID lpvReserved)
{
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
// The DLL is being loaded for the first time by a given
process.
// Perform per-process initialization here. If the
initialization
// is successful, return TRUE; if unsuccessful, return FALSE.
break;
case DLL_PROCESS_DETACH:
// The DLL is being unloaded by a given process. Do any
// per-process clean up here, such as undoing what was done in
// DLL_PROCESS_ATTACH. The return value is ignored.
break;
case DLL_THREAD_ATTACH:
// A thread is being created in a process that has already
loaded
// this DLL. Perform any per-thread initialization here. The
// return value is ignored.
break;
case DLL_THREAD_DETACH:
// A thread is exiting cleanly in a process that has already
// loaded this DLL. Perform any per-thread clean up here. The
// return value is ignored.
break;
}
return TRUE;
}
Bye, Olaf.