Re: Using C++ classes with IDL [message #16380] |
Fri, 23 July 1999 00:00 |
ushomirs
Messages: 14 Registered: May 1993
|
Junior Member |
|
|
i presume you would do the same thing as when linking with C,
but declare your C++ functions as extern "C", i.e.
extern "C" void foo(...);
calling a class member function would be trickier.
greg
In article <3795FB3B.DECDAD80@nodc.noaa.gov>,
Michael Ford <mford@nodc.noaa.gov> wrote:
> Has anyone ever linked C++ with IDL? I would like some advice on how
to
> do this. The call external instructions talk about linking C, but not
> C++.
>
> What do I do in my IDL program?
> Do I need a middle program?
> What do I have to do to my C++ classes, if anything?
>
> Thanks
>
> Mike Ford
> NOAA/NODC
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
|
|
|
Re: Using C++ classes with IDL [message #16408 is a reply to message #16380] |
Thu, 22 July 1999 00:00  |
marco_k
Messages: 1 Registered: July 1999
|
Junior Member |
|
|
In article <3795FB3B.DECDAD80@nodc.noaa.gov>,
Michael Ford <mford@nodc.noaa.gov> wrote:
> Has anyone ever linked C++ with IDL? I would like some advice on how
to
> do this. The call external instructions talk about linking C, but not
> C++.
@You can use C++, but keep in mind that you cannot export a method of a
class.
In IDL (at least in version 5.2) you can also make a dynamic loadable
module (DLM). Dependig on what system you're on, this is a DLL or shared
library.
> What do I do in my IDL program?
@In IDL the functions you put in the DLL become a part of the IDL system
routines. This has some advantages in error handling and an easier
interface to the routines.
> Do I need a middle program?
@Not if you have the source of the DLL.
> What do I have to do to my C++ classes, if anything?
@Basically make sure you have some wrapperfunctions to access the
objects you want to manipulate.
@More information can be found in the "External Development Guide"
> Thanks
>
> Mike Ford
> NOAA/NODC
Bye,
Marco
-----------------------------------------------
ing. Marco Konijnenburg
FOM instituut AMOLF
Kruislaan 407 1098 SJ Amsterdam Nederland
Tel: (+31) 020 6081234 Fax: (+31) 020 6684106
-----------------------------------------------
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
|
|
|
Re: Using C++ classes with IDL [message #16409 is a reply to message #16408] |
Thu, 22 July 1999 00:00  |
Justin Ashmall
Messages: 15 Registered: May 1999
|
Junior Member |
|
|
Michael Ford <mford@nodc.noaa.gov> wrote in message
news:3795FB3B.DECDAD80@nodc.noaa.gov...
> Has anyone ever linked C++ with IDL? I would like some advice on how to
> do this. The call external instructions talk about linking C, but not
> C++.
What platform are you using? Unix, Mac, Windows..?
I had no problem compiling C++ into a library (dll) under Windows and using
call_external - I didn't have to do anything different because it was C++ as
opposed to C.
Justin
|
|
|