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

Home » Public Forums » archive » Help! pointer address return using idl_tools DLM (EXTPROC_DEFINE)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Help! pointer address return using idl_tools DLM (EXTPROC_DEFINE) [message #38476] Thu, 11 March 2004 08:43 Go to previous message
andy_capax is currently offline  andy_capax
Messages: 1
Registered: March 2004
Junior Member
Hi

I'm a newbie to Idl. I downloaded the idl_tools DLM library from Ronn
Kling's website http://www.rlkling.com. I"m trying to access from idl
the address of a float pointer returned by a function in C++.
In my C++ program I have:

float* cppfunc(int); //not part of any class


I get the output of the C++ program as sample.dll file using visual
studio 6.0

In Idl I correspondingly use the call:

addr = EXTPROC_DEFINE("idlfunc", "sample.dll", "cppfunc",
"p(i)",/CDECL)
;to get the address of the pointer since the documentation says " If
;the return value is a pointer, the
;memory address returned by the function will be placed in
;an IDL unsigned long and returned to the IDL application."

var = EXTPROC_DEREF(addr, FLOAT = 5)
;to dereference the pointer and copy the data pointed by it to an idl
variable
;it is supposed to copy the 5 float members of the C++ array to var

My problem is this:
addr does not point to a valid memory address, but points to 1 or
0..thus the next step of dereferencing also fails.

I know that it is not a problem with the dll or any such, since
returning a float or an int (not a pointer) works fine using this
approach. I need to pass the address since its a large array and want
to avoid writing my own DLM's for lack of skill.

Can anyone please help? I"m really stuck and dont know what to do..

Thanks all..
[Message index]
 
Read Message
Read Message
Previous Topic: cw_field: checking entries
Next Topic: Maximum Likelihood processing time

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

Current Time: Thu Oct 09 22:38:52 PDT 2025

Total time taken to generate the page: 0.37443 seconds