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

Home » Public Forums » archive » Re: Can CALL_EXTERNAL be used to access C++?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Can CALL_EXTERNAL be used to access C++? [message #10636] Wed, 31 December 1997 00:00
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <34AA5473.390C90CD@jhuapl.edu>, Martha Kusterer <Martha.Kusterer@jhuapl.edu> writes:
> Hi,
> Can IDL be used to call C++ routines using CALL_EXTERNAL? I am
> currently trying to decide if I want to use C++ instead of C to code a
> processing system. Some of the I/O routines will be accessed from IDL to
> display the data.
>
> I couldn't find any mention of C++ in the documentation.

Yes it can, but I think you need to make a function with C linkage which is
what IDL will call with CALL_EXTERNAL. That C linkage function should process
the (argc, argv) arguments and call the C++ linkage functions. I am doing this
routinely on both Unix and Windows.

// my_cc_func.cc
int my_cc_func(int *p1, ...)
{
...
}
extern "C"
{
int myfunc(int argc, void *argv[])
{
return my_cc_func(argv[0], ...);
}
}


____________________________________________________________
Mark Rivers (773) 702-2279 (office)
CARS (773) 702-9951 (secretary)
Univ. of Chicago (773) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)

or:
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: JHU/APL/S1R IDL Library update.
Next Topic: Can CALL_EXTERNAL be used to access C++?

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

Current Time: Wed Oct 08 22:11:01 PDT 2025

Total time taken to generate the page: 0.08020 seconds