Hi,

I created a dll using MFC AppWizard(dll). I had a test program writen
in VC++ 6. The dll worked fine with the test program. But I got
"Cannot load 32-bit DLL "name" (Error 1753)" in FoxPro. I am new to
VFP. Could anyone shed some light on this? Thanks in advance,

Carol

Re: Cannot load 32-bit DLL "name" (Error 1753) by Dan

Dan
Fri Aug 04 11:42:17 CDT 2006

Can you post the code that's throwing this error?

Dan

beihong@gmail.com wrote:
> Hi,
>
> I created a dll using MFC AppWizard(dll). I had a test program writen
> in VC++ 6. The dll worked fine with the test program. But I got
> "Cannot load 32-bit DLL "name" (Error 1753)" in FoxPro. I am new to
> VFP. Could anyone shed some light on this? Thanks in advance,
>
> Carol



Re: Cannot load 32-bit DLL "name" (Error 1753) by beihong

beihong
Fri Aug 04 12:19:12 CDT 2006

Here is the code. Thanks

in .cpp:
long __cdecl MyDLLFunction()
{
}

in .def:
LIBRARY MyDll
EXPORTS
MyDLLFunction@1

in VFP:
DECLARE LONG MyDLLFunction IN "J:\Carol\MyDll.dll"
ReturnCode=MyDLLFunction()

Dan Freeman wrote:
> Can you post the code that's throwing this error?
>
> Dan
>
> beihong@gmail.com wrote:
> > Hi,
> >

> > I created a dll using MFC AppWizard(dll). I had a test program writen
> > in VC++ 6. The dll worked fine with the test program. But I got
> > "Cannot load 32-bit DLL "name" (Error 1753)" in FoxPro. I am new to
> > VFP. Could anyone shed some light on this? Thanks in advance,
> >
> > Carol


Re: Cannot load 32-bit DLL "name" (Error 1753) by abdeslam

abdeslam
Fri Aug 04 15:13:47 CDT 2006

Hi,

Perhaps a missing dependent dll ? Open MyDll.dll with \Program
Files\Microsoft Visual Studio\Common\Tools\DEPENDS.EXE to verify.

Abdeslam

beihong@gmail.com a écrit :
> Here is the code. Thanks
>
> in .cpp:
> long __cdecl MyDLLFunction()
> {
> }
>
> in .def:
> LIBRARY MyDll
> EXPORTS
> MyDLLFunction@1
>
> in VFP:
> DECLARE LONG MyDLLFunction IN "J:\Carol\MyDll.dll"
> ReturnCode=MyDLLFunction()
>
> Dan Freeman wrote:
>
>>Can you post the code that's throwing this error?
>>
>>Dan
>>
>>beihong@gmail.com wrote:
>>
>>>Hi,
>>>
>
>
>>>I created a dll using MFC AppWizard(dll). I had a test program writen
>>>in VC++ 6. The dll worked fine with the test program. But I got
>>>"Cannot load 32-bit DLL "name" (Error 1753)" in FoxPro. I am new to
>>>VFP. Could anyone shed some light on this? Thanks in advance,
>>>
>>>Carol
>
>

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.