Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 27 FEB 2004 11:08:14AM matt bavis wrote:

I have only worked a little with calling a DLL, so I would like to see if anyone can spot my error. When I try to call one of the DLL functions I get the following message "Function CSTAGE_GET_NUMBER_OF_SCHEMAS does not exist in dynamic link library CSTAGE.DLL".

I'm not sure if the names are case sensitive, the error message displays the function name in all Caps, but the function name is actually "Cstage_get_number_of_schemas". I used a utility to read the DLL to make sure my function existed and to make sure my spelling is correct.

I have placed my dll "CSTAGE.DLL" into my oinsight directory. I created a record in SYSPROCS with the following

CSTAGE

UINT PASCAL CStage_get_number_of_schemas(VOID)

I ran DECLARE_FCNS "DLL_CSTAGE".

I DECLARE FUNCTION CStage_get_number_of_schemas

but when I try to use the function I get the above error message.

Am I missing any steps??? Or any advice as to what I should look at next?

Thanks,

matt


At 27 FEB 2004 11:13AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Matt,

I'm not sure if the names are case sensitive, the error message displays the function name in all Caps, but the function name is actually "Cstage_get_number_of_schemas". I used a utility to read the DLL to make sure my function existed and to make sure my spelling is correct.

Names in the *declaration* are case sensitive, though not when you call the function in your basic+ program

I have placed my dll "CSTAGE.DLL" into my oinsight directory. I created a record in SYSPROCS with the following CSTAGE UINT PASCAL CStage_get_number_of_schemas(VOID)

Are you sure about the calling convention? PASCAL was the standard for Win16, STDCALL is the standard for Win32, so try that instead.

The Sprezzatura Group

World leaders in all things RevSoft


At 27 FEB 2004 11:18AM matt bavis wrote:

I have tried both conventions, and I get the same error. I set it back to STDCALL, ran DECLARE_FCNS, and I am still getting the same message.


At 27 FEB 2004 11:22AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Did you log out of OI after you ran declare_fcns? The declare_fcns routine doesn't knock the old DLL stub off the program stack, so you really need to get it refreshed…

The Sprezzatura Group

World leaders in all things RevSoft


At 27 FEB 2004 11:31AM matt bavis wrote:


At 27 FEB 2004 11:38AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

Actually, looking at the source for the DLL you may find the calling convention is CDECL rather than STDCALL… so give that one a try :)

The Sprezzatura Group

World leaders in all things RevSoft


At 27 FEB 2004 12:34PM matt bavis wrote:


At 27 FEB 2004 12:37PM matt bavis wrote:

That still did not correct the error. How can I confirm I am using the correct calling convention?


At 27 FEB 2004 01:05PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

So you tried CDECL? What does the CSTAGE DLL documentation say? You're sure it's 32-bit DLL?

Try using the isLib() function to see if it can actually by found and loaded by OI. It may be a dependancy issue - as in CSTAGE.DLL may need other DLL's to be in the path before it can load.

declare function isLib

ok=isLib( "CSTAGE.DLL" )

The Sprezzatura Group

World leaders in all things RevSoft


At 27 FEB 2004 01:35PM matt bavis wrote:

Islib returns a 1.

The documentations doesn't mention which convention should be used to call the functions. What I do know about the DLL is it is written in C. I have access to the source code, it is public domain, will that answer any questions? In regards to whether the dll is 32-bit I am not 100% certain. I was getting the same errors in a 16-bit account so I moved to a 32-bit account prior to this morning. When I read the header of the DLL the subsystem is Win32GUI.

thanks,

Matt


At 27 FEB 2004 03:28PM matt bavis wrote:

Any other suggestions, or tips?

thanks,

Matt


At 27 FEB 2004 04:56PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:

This IS the Cancer Staging routines yes?

#ifdef WIN32

  #ifdef CSTAGE_EXPORTS
  #define CSTAGE_API __declspec(dllexport)
  #else
  #define CSTAGE_API __declspec(dllimport)
  #endif

#else

  #define CSTAGE_API
  #define _stdcall

#endif

So it seems to be using CDECL. Can you post your MODIFIED declaration for us to check?

The Sprezzatura Group

World Leaders in all things RevSoft


At 27 FEB 2004 05:31PM matt bavis wrote:

Yes, the routine is for collaborative staging (cancer related). I have made some progress. I noticed they also had made a DLL specifically for Visual Basic. This DLL functions as a shell around the CSTAGE.DLL. I gave it a try and it seems to be working and I'm using STDCALL to call the functions in the VB dll csdllvb.dll.

But I'm curious why I can use the functions in the CSTAGE.DLL directly. My modified SYSPROCS looks like this for the CSTAGE.DLL

CSTAGE

UINT CDECL CStage_get_number_of_schemas(VOID)

Thanks,

Matt


At 27 FEB 2004 05:34PM matt bavis wrote:

Sorry I had a typo in the previous post.

I meant to say "I am curious why I "Can't" call functions in the CSTAGE.DLL directly"….

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/25eb1d7a86318c4985256e470058a557.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1