<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2873" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I have some problems trying to upgrade an old 
omniOrb 2.7.1 project (VC++6) to omniORB 4.0.7 (VC++7).<BR>Some functions are 
working, others are not.<BR>Func1 below is working (returns a sequence of 
short).<BR>Func2 below is not working as it did before (returns a sequence of a 
complex struct). The client gets the result, but at the same time the server 
crashes with the following error:<BR>HEAP[xxx.exe]: Invalid Address specified to 
RtlValidateHeap( 003C0000, 0052BA30 )<BR>Unhandled exception at 0x7c901230 in 
xxx.exe: User breakpoint.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The error occurs after my code has returned, 
somewhere in the Corba code.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The only difference as I see it is that the out 
parameter is more complex in the functions that not works.<BR>All fields in the 
struct are initialized.<BR>What am I missing? Any ideas?</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=Arial size=2>
<DIV><BR>tRetcode xxx_i::Func1(const tTransId &amp; TransIDRequest, 
tProviderList_out provider)<BR>{<BR>&nbsp;tProviderList *providerT = new 
tProviderList;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;providerT-&gt;provider.length(1);<BR>&nbsp;short *prov = 
&amp;(providerT-&gt;provider.operator[](0));<BR>&nbsp;*prov = 
atoi(g_sTopLevelRegionId);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;provider = providerT;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;return API_OK;<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>tRetcode xxx_i::Func2(const tTransId &amp; TransIDRequest, 
tTransitionList_out transitions)<BR>{<BR>&nbsp;tTransitionList *transitionsT = 
new 
tTransitionList;<BR>&nbsp;//transitionsT-&gt;transition.length(0)<BR>&nbsp;<BR>&nbsp;char 
sTemp[20];<BR>&nbsp;long lAllTrans;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;lAllTrans = vTPEus.size();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;transitionsT-&gt;transition.length(lAllTrans);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;for (long i=0; i&lt; lAllTrans; i++) {<BR>&nbsp;&nbsp;tTransition 
*trans= &amp;(transitionsT-&gt;transition.operator[](i));</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;trans-&gt;importance = 0; 
//<BR>&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;trans-&gt;entry.key.key.providerCode = 
0;<BR>&nbsp;&nbsp;trans-&gt;entry.key.key.key = 
CORBA::string_dup(_ltoa(vTPEus[i], 
sTemp,10));<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;trans-&gt;entry.key.type = 
INPUT_STOP;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;trans-&gt;entry.key.name = 
CORBA::string_dup(vTPName[i].c_str());</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;trans-&gt;entry.key.location.topLevelRegion = 
CORBA::string_dup("");<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.topLevelRegionId 
= CORBA::string_dup("");<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.type = 
0;<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.name = 
CORBA::string_dup("");<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.region = 
CORBA::string_dup("");<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.regionId = 
CORBA::string_dup("");<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.zip = 
CORBA::string_dup("");<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.houseno = 
CORBA::string_dup("");</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;//coordinates<BR>&nbsp;&nbsp;long lXcoord = 
vTPXcoord[i];<BR>&nbsp;&nbsp;long lYcoord = 
vTPYcoord[i];<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.coord.xcoord = 
lXcoord;<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.coord.ycoord = 
lYcoord;<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.coord.zcoord = 
0;<BR>&nbsp;&nbsp;trans-&gt;entry.key.location.coord.precision = -1; 
//unknown</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;trans-&gt;entry.key.side.length(0); //</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;//duration, legs, wait<BR>&nbsp;&nbsp;trans-&gt;entry.duration 
= -1;<BR>&nbsp;&nbsp;trans-&gt;entry.legs = 
-1;<BR>&nbsp;&nbsp;trans-&gt;entry.wait = vTPComp[i];<BR>&nbsp;}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;transitions = transitionsT;<BR>&nbsp;<BR>&nbsp;return 
API_OK;<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>Best regards<BR>Anders Werholt</DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT>&nbsp;</DIV></BODY></HTML>