I have written a DLL using Microsoft Visual C++ version 6.0. I can access the functions from this dll from my C++ programs. But when I try to access them from OpenInsight 32-bit version I get the following error:
ENG0805: TEST, line 7. Function fnTest2dll does not exist in dynamic link libray TEST2DLL.
This is what my TEST program looks like:
Compile Function Test(a,b)
Declare Function fnTestdll
Declare Function fnTest2dll
Declare Function GetSystemMetrics
Declare Subroutine RowSel
i=GetSystemMetrics(22)
val=fnTest2dll()
RowSel("",252,253,"","",0,"","")
output=a:" plus ":b
Return output
This is what my Prototype Record for DLL_TEST2DLL looks like:
TEST2DLL
INT PASCAL fnTest2dll(VOID)
What happens if you prototype with STDCALL eg
ULONG STDCALL GetPrivateProfileStringA(LPCHAR,LPCHAR,LPCHAR,LPCHAR,ULONG,LPCHAR) AS GETPRIVATEPROFILESTRING
World Leaders in all things RevSoft
Actualy, I think what is happening is that the C++ DLL is exporting the "decorated" name.
I haven't been able to find what to do in the C++ code, to export the "undecorated" name!
Jeff,
Create a .DEF file and add the name of your entry point to it.Pat
Yes, I did that and saw that I've gotten rid of the "mangled" names, but OI still doesn't see the function1
fyi: I found what was missing! In my DEF file for the dll I did not specify "PRIVATE"… OI now finds my functions!
Glad you got it to work. I am not sure why PRIVATE is needed though. If I had the functions OiFunc1 and OiFunc2 that I wanted OI to get at, my .DEF would be the following:
EXPORTS OiFunc1 OiFunc2and that's it.
Pat