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

Home » Public Forums » archive » Re: simple CALL_EXTERNAL
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: simple CALL_EXTERNAL [message #53757] Tue, 01 May 2007 18:35
Paul Sommer is currently offline  Paul Sommer
Messages: 9
Registered: December 2006
Junior Member
On May 1, 7:23 am, "skymaxw...@gmail.com" <skymaxw...@gmail.com>
wrote:
> as i can see there is two ways using CALL_EXTERNAL in IDL
>
> 1. without wrapped procedure. Only C function and CALL_EXTERNAL from
> IDL
>
> 2. with wrapped procedure. For it i need C-wrapper procedure and
> another C functions, and then CALL_EXTERNAL
> in both ways i need create DLL from C source code
>
> does somebody have simple examples for both ways ? (except C:\RSI\...
> \call_external\C)
>
> thanks

Personally I find Randy Frank's EXTPROC function really nice and easy
for accessing exported functions in pre-compiled dlls. Obviously
this assumes you've already compiled to a dll. See the following
IDL_Tools_63.zip archive in the Code Contrib. area on the ITT VIS
website (Thanks to Ronn Kling for originally hosting pre-IDL 6.3
versions from his website):

http://ittvis.com/codebank/search.asp?FID=431

Best regards,
Paul
Re: simple CALL_EXTERNAL [message #53772 is a reply to message #53757] Tue, 01 May 2007 06:23 Go to previous message
skymaxwell@gmail.com is currently offline  skymaxwell@gmail.com
Messages: 127
Registered: January 2007
Senior Member
as i can see there is two ways using CALL_EXTERNAL in IDL

1. without wrapped procedure. Only C function and CALL_EXTERNAL from
IDL

2. with wrapped procedure. For it i need C-wrapper procedure and
another C functions, and then CALL_EXTERNAL
in both ways i need create DLL from C source code


does somebody have simple examples for both ways ? (except C:\RSI\...
\call_external\C)

thanks
Re: simple CALL_EXTERNAL [message #53773 is a reply to message #53772] Tue, 01 May 2007 04:52 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
have you tried this under linux? If it works there, my guess is you forgot
to export the symbol bmean. Haje


<skymaxwell@gmail.com> wrote in message
news:1177967940.895398.317470@u30g2000hsc.googlegroups.com.. .
> how call c - function from IDL for Windows
>
> for example example.cpp
>
> double bmean(float *array,int n)
> {
> double total=0.0;
> int i;
> for (i=0;i<n;i++) total+=(*array++);
> return (total/(double)n);
> }
>
> now i build example.dll
>
> now from idl
>
> idl> arr=randomu(s,1000000)*10000.0
> idl>mean=call_external("D:\WORK\idl\example\Debug
> \example.dll","bmean",arr, n_elements(arr),/d_value)
>
>
> i've got error - not found procedure
>
> CALL_EXTERNAL: Error loading sharable executable.
> Symbol: bmean, File = D:\WORK\idl\example\Debug
> \example.dll
>
> also i try with
> idl>mean=call_external("D:\WORK\idl\example\Debug\example.dll ","?
> bmean@@YANPAMH@Z",arr, n_elements(arr),/d_value)
>
> the same error
> i was try on both VC7.0 and VC6.0
>
> thanks
>
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Antarctic Temperature Data
Next Topic: Re: Compiling a DLL?

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

Current Time: Wed Oct 08 15:34:29 PDT 2025

Total time taken to generate the page: 0.00516 seconds