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

Home » Public Forums » archive » IDL and DLL under windows
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
IDL and DLL under windows [message #24650] Tue, 10 April 2001 01:43
StefanoM is currently offline  StefanoM
Messages: 5
Registered: April 2001
Junior Member
sorry for this long post.

well, I would like to use my Fortran subroutine with IDL.
To do this I have created a DLL whit MS Develop. Studio and then called the
subroutines from IDL with CALL_EXTERNAL. The problem is that ... it doesn't
work!!! This could be related to the way the parameters are passed to the
soubroutines, by value or by reference. If I simply compile and link the
subroutines 'as they are' into a DLL, then it is impossible to call them
from IDL, otherwise, if I follow the example given with IDL (5.2):


SUBROUTINE SUM_ARRAY(argc, argv) !Called by IDL
INTEGER*4 argc, argv(*) !Argc and Argv
are integers

j = LOC(argc)
!Obtains the number of arguments (argc)

!Because argc is passed by VALUE.

c Call subroutine SUM_ARRAY1, converting the IDL parameters
c to standard FORTRAN, passed by reference arguments:

CALL SUM_ARRAY1(%VAL(argv(1)), %VAL(argv(2)), %VAL(argv(3)))
RETURN
END

c This subroutine is called by SUM_ARRAY and has no
c IDL specific code.
c
SUBROUTINE SUM_ARRAY1(array, n, sum)
INTEGER*4 n
REAL*4 array(n), sum

sum=0.0
DO i=1,n
sum = sum + array(i)
ENDDO
RETURN
END


I get errors during the linking of the DLL, in particular: 'undefined
symbol' related to the subroutine (SUM_ARRAY1) called from the 'interface'
subroutine (i.e. SUM_ARAY that manages the passage of the parameters from
IDL to DLL).

Does anyone have experience about this ? Any suggestion ?

Stefano

stefano.massetti@katamail.com
[Message index]
 
Read Message
Previous Topic: dialog_pickfile
Next Topic: Re: IDL and DLL under windows

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

Current Time: Wed Oct 08 15:53:18 PDT 2025

Total time taken to generate the page: 0.00394 seconds