, , ,

Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

RE: OpenInsight 32-bit not finding functions in my dll's (OpenInsight 32-Bit)

At 08 AUG 2002 08:59:51AM Jeff Warvel wrote:

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)


At 08 AUG 2002 09:41AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

What happens if you prototype with STDCALL eg

ULONG STDCALL GetPrivateProfileStringA(LPCHAR,LPCHAR,LPCHAR,LPCHAR,ULONG,LPCHAR) AS GETPRIVATEPROFILESTRING

The Sprezzatura Group

World Leaders in all things RevSoft


At 08 AUG 2002 03:57PM Jeff Warvel wrote:

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!


At 08 AUG 2002 05:27PM Pat McNerthney wrote:

Jeff,

Create a .DEF file and add the name of your entry point to it.

Pat


At 09 AUG 2002 08:15AM Jeff Warvel wrote:

Yes, I did that and saw that I've gotten rid of the "mangled" names, but OI still doesn't see the function1


At 09 AUG 2002 09:21AM Jeff Warvel wrote:

fyi: I found what was missing! In my DEF file for the dll I did not specify "PRIVATE"… OI now finds my functions!


At 09 AUG 2002 01:04PM Pat McNerthney wrote:

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
  OiFunc2

and that's it.

Pat

View this thread on the Works forum...