the problem of using CALL_EXTERNAL() [message #65470] |
Mon, 02 March 2009 18:39 |
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 : Áíһ¸ö³ÌÐòÕýÔÚʹÓôËÎļþ£¬½ø³ÌΨ· ÃÎʡ£
|
|
|