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

Home » Public Forums » archive » Need help passing string data 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
Need help passing string data using CALL_EXTERNAL. [message #37639] Tue, 13 January 2004 17:05 Go to next message
Jacob.Spinsby is currently offline  Jacob.Spinsby
Messages: 1
Registered: January 2004
Junior Member
I am attempting to pass 2 filenames (strings), 3 integers, and a
double entered in the parameters section of CALL_EXTERNAL to a DLL I
have created. I have no problems passing the integers and the double
using the portable calling convention, but I am having significant
difficulty figuring out how to pass strings. I have only recently
begun to learn IDL, so I am not that familiar with it. Any help would
be greatly appreciated. Thanks
Re: Need help passing string data using CALL_EXTERNAL. [message #37776 is a reply to message #37639] Wed, 28 January 2004 01:40 Go to previous message
ebertf is currently offline  ebertf
Messages: 12
Registered: January 2004
Junior Member
Jacob.Spinsby@asu.edu (JSpin) wrote in message news:<f4a782c4.0401131705.3876b019@posting.google.com>...
> I am attempting to pass 2 filenames (strings), 3 integers, and a
> double entered in the parameters section of CALL_EXTERNAL to a DLL I
> have created. I have no problems passing the integers and the double
> using the portable calling convention, but I am having significant
> difficulty figuring out how to pass strings. I have only recently
> begun to learn IDL, so I am not that familiar with it. Any help would
> be greatly appreciated. Thanks

Hi,
I had the same problem, but it worked out fine when I use this code:

DLL WRAPPERFUNCTION for the function dllquest of MYDLL.DLL for the
function COMPILED IN C:
The string is passed by reference:

#include "stdio.h"
#include "idl_export.h"
<Headers required for MYDLL>

_declspec(dllexport) IDL_INT IDL_CDECL wrappdllquest(int argc, void
*argv[])
{
return (dllquest(((char *) argv[0]);
}

compiling the wrapper DLL looked like this:
cl -DLL -DWIN32 -D_MT /nologo /I"C:\RSI\IDL60\external\include"
/I"D:\idl\flopro\motoren\<path to MYDLL>" /c mydllglue.c
/Fomydllglue.obj

linking the wrapper DLL looked like this:
link /out:mydllglue.dll /nologo /nodefaultlib /dll piglue.obj
"C:\RSI\IDL60\bin\bin.x86\idl32.lib" MYDLL.lib msvcrt.lib kernel32.lib

The IDL CALL_EXTERNAL should look like this:

result=call_external(<gluepath>,'wrappdllquest','your string to
pass',/i_value,/cdecl,value=[0])


Florian
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: VNC and IDL problems
Next Topic: Re: Object Graphics + Convolution with Point Spread Function

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

Current Time: Wed Oct 08 16:01:09 PDT 2025

Total time taken to generate the page: 0.00621 seconds