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

Home » Public Forums » archive » Problems with array elements as parameter in c++ function used via 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
Problems with array elements as parameter in c++ function used via call_external [message #64856] Thu, 22 January 2009 00:54
Andreas Bjärkmar is currently offline  Andreas Bjärkmar
Messages: 3
Registered: January 2009
Junior Member
Hi!
I have run into a strange problem when using a c++ (compiled as extern
"C") dll. The problem rises when I'm calling a method to an object
I've created. When testing the parameters are in a valid range th c-
program throughs an error.
The calling in IDL looks like:
res = CALL_EXTERNAL('C:\Workspace\libmydll.dll', 'GraphCut'$
, edge_values ,T_Weights, no_of_elem, flow, labels, edges,
no_of_nodes, no_of_edges, $
VALUE=[0,0,1,0,0,0,1,1], /CDECL)

The c++ calling looks like:
g -> add_edge(edges[0], edges[1],edges[2],edges[3]);
*flow = edges[0];
and the error occurs somewhere at:
template <typename captype, typename tcaptype, typename flowtype>
inline void Graph<captype,tcaptype,flowtype>::add_edge(node_id _i,
node_id _j, captype cap, captype rev_cap)
{
assert(_i >= 0 && _i < node_num); //<-------This line
assert(_j >= 0 && _j < node_num); //<-------Or this line
...}

The strange thing is that flow that is given a value from the array
holds a value that is valid and if I send the values one-by-one by
value it works fine.

Regards, Andreas Bjärkmar
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: IDL Export Bridge Assistant Wierdness
Next Topic: Re: axis ystyle=0 double rounding problem

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

Current Time: Thu Oct 09 23:02:28 PDT 2025

Total time taken to generate the page: 0.15075 seconds