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

Home » Public Forums » archive » calling function in DLL compiled with C++
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: calling function in DLL compiled with C++ [message #28798 is a reply to message #28680] Thu, 10 January 2002 14:11 Go to previous messageGo to previous message
Richard Younger is currently offline  Richard Younger
Messages: 43
Registered: November 2000
Member
Dominik Paul wrote:
>
> Hi NG,
>
> I tried to write a DLL suing C++. But I have a big problem,
> calling the function in the DLL out of IDL, when the DLL is
> compiled using a C++-compiler.
[...]
>
> Dom

Hi, Dom.

Are you still having trouble? I've got a few examples lying around for
VC++, but I don't know what compiler you're using. I certainly second
Gert's suggestion about using .def files if you're in VC++.

If things still aren't working, you can use the extern "C" construct to
force your C++ compiler to use C names and calling conventions in most
compilers.

Just add something like


#ifdef __cplusplus
extern "C" {
#endif

/* C callable prototypes here */

#ifdef __cplusplus
}
#endif


to your header file around IDL_load() or the externally visible
functions. More info at
<http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html>.


Best,
Rich

--
Richard Younger
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: idl5.5 widget_draw and color
Next Topic: All day FFT....

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

Current Time: Sat Oct 11 07:11:13 PDT 2025

Total time taken to generate the page: 1.15381 seconds