comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Q: interfacing IDL to DLL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Q: interfacing IDL to DLL [message #16498 is a reply to message #16480] Thu, 29 July 1999 00:00 Go to previous messageGo to previous message
FIT is currently offline  FIT
Messages: 9
Registered: June 1999
Junior Member
Hi,

I feel to some extend the compiler (and esp. linker) You use might play an
important role. I can give You a brief report of my experiences with
Micro$$$ Visual Studio/VC 5.0:

1.) Suppose You want to create a WIN32 DLL (no MFCs)
2.) Declare the functions You want to export from the DLL as LONG DLLEXPORT

3.) Enclose the prototypes in #ifdef __cplusplus extern "C" .... #endif
4.) The parameter list of the exported functions must be of (LONG argc,
void* argv[]) and nothing else; (#define LONG unsigned long)
5.) Take extreme care with the data formats of BYTE, INT, LONG and when
passind IDL strings. I advice You strongly to leave the memory management
either to the IDL part or to the C part. Don't mix.
6.) After compiling and linking the DLL have a look at its export table.
Make sure that the functions You want to export are listed there without
signatures (that's important and one reason why it is extremely difficult to
interface to C++). Remember the exact names. Put the DLL where You like (in
Your LIB search path might bre advantageous)
7.) Do the IDL CALL_EXTERNAL; make sure the path to the DLL is correct; use
the exact name of the function to be called. As this name is being looked up
in the DLL's export table make sure again the upper and lower cases are
correct !
8.) Pray !

Good luck !

Arno R. Schleich, MS, MD

"Herbert H. Tsang" wrote:

> Anyone has epxerience in interfacing IDL to C functions' DLL? Is
> there anything special I need to do in order to make a DLL that's works?
>
> -- Herbert (tsang@vcn.bc.ca)

--
Functional Imaging Technologies GmbH
Siemensstr. 40/41
12247 Berlin
Germany

fon.: +49 (0)30 76 90 24 80
fax.: +49 (0)30 76 90 24 81

mailto:fit@functional-imaging.com
htp://www.functional-imaging.com
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: IDL 5.3 Beta Program
Next Topic: A line command for printing graphs.

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 13:03:23 PDT 2025

Total time taken to generate the page: 1.30286 seconds