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

Home » Public Forums » archive » the problem of using 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
the problem of using CALL_EXTERNAL() [message #65470] Mon, 02 March 2009 18:39
mengran is currently offline  mengran
Messages: 5
Registered: March 2009
Junior Member
Hello , everyone! I am new here.
I just want to learn using the func of CALL_EXTERNAL(), after reading
the demo that IDL provides(call_external_C), I write a simple test
procedure, but the outcome of the test really confused me a lot. who
can tell me why? Thank you a lot!




IDL SCRIPT:
PRO text1

x = 3
y = 4
call_ex_dir = FILEPATH('', SUBDIRECTORY=
[ 'external','call_external','C' ])
source = 'IDL_C_TEST'
MAKE_DLL, source, 'IDL_C_TEST', 'IDL_C_TEST', $
INPUT_DIR=call_ex_dir, DLL_PATH=shlib, $
VERBOSE=verbose, SHOW_ALL_OUTPUT=verbose
IF (CALL_EXTERNAL(shlib,'IDL_C_TEST', $
x, y,/CDECL, $
AUTO_GLUE=auto_glue, VERBOSE=verbose, $
SHOW_ALL_OUTPUT=verbose) EQ 1) then BEGIN
PRINT,'After calling simple_vars:'
PRINT, x,y
HELP,shlib
ENDIF
END

C SCRIPT:
#include <stdio.h>
#include "idl_export.h" /* IDL external definitions */
int IDL_C_TEST(int *x, int *y)
{

*x = *x + 1;
*y = *y + 1;
return 1;
}

THE RESULT IS : Áíһ¸ö³ÌÐòÕýÔÚʹÓôËÎļþ£¬½ø³ÌÎ޷¨· ÃÎʡ£
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Common x- and y-axes labels.....
Next Topic: Re: crazy question

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

Current Time: Wed Oct 08 19:42:04 PDT 2025

Total time taken to generate the page: 0.00604 seconds