<!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> </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> </DIV>
<DIV><FONT face=Arial size=2>The error occurs after my code has returned,
somewhere in the Corba code.</FONT></DIV>
<DIV> </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> </DIV><FONT face=Arial size=2>
<DIV><BR>tRetcode xxx_i::Func1(const tTransId & TransIDRequest,
tProviderList_out provider)<BR>{<BR> tProviderList *providerT = new
tProviderList;</DIV>
<DIV> </DIV>
<DIV> providerT->provider.length(1);<BR> short *prov =
&(providerT->provider.operator[](0));<BR> *prov =
atoi(g_sTopLevelRegionId);</DIV>
<DIV> </DIV>
<DIV> provider = providerT;</DIV>
<DIV> </DIV>
<DIV> return API_OK;<BR>}</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>tRetcode xxx_i::Func2(const tTransId & TransIDRequest,
tTransitionList_out transitions)<BR>{<BR> tTransitionList *transitionsT =
new
tTransitionList;<BR> //transitionsT->transition.length(0)<BR> <BR> char
sTemp[20];<BR> long lAllTrans;</DIV>
<DIV> </DIV>
<DIV> lAllTrans = vTPEus.size();</DIV>
<DIV> </DIV>
<DIV> transitionsT->transition.length(lAllTrans);</DIV>
<DIV> </DIV>
<DIV> for (long i=0; i< lAllTrans; i++) {<BR> tTransition
*trans= &(transitionsT->transition.operator[](i));</DIV>
<DIV> </DIV>
<DIV> trans->importance = 0;
//<BR> <BR> trans->entry.key.key.providerCode =
0;<BR> trans->entry.key.key.key =
CORBA::string_dup(_ltoa(vTPEus[i],
sTemp,10));<BR> <BR> trans->entry.key.type =
INPUT_STOP;</DIV>
<DIV> </DIV>
<DIV> trans->entry.key.name =
CORBA::string_dup(vTPName[i].c_str());</DIV>
<DIV> </DIV>
<DIV> trans->entry.key.location.topLevelRegion =
CORBA::string_dup("");<BR> trans->entry.key.location.topLevelRegionId
= CORBA::string_dup("");<BR> trans->entry.key.location.type =
0;<BR> trans->entry.key.location.name =
CORBA::string_dup("");<BR> trans->entry.key.location.region =
CORBA::string_dup("");<BR> trans->entry.key.location.regionId =
CORBA::string_dup("");<BR> trans->entry.key.location.zip =
CORBA::string_dup("");<BR> trans->entry.key.location.houseno =
CORBA::string_dup("");</DIV>
<DIV> </DIV>
<DIV> //coordinates<BR> long lXcoord =
vTPXcoord[i];<BR> long lYcoord =
vTPYcoord[i];<BR> trans->entry.key.location.coord.xcoord =
lXcoord;<BR> trans->entry.key.location.coord.ycoord =
lYcoord;<BR> trans->entry.key.location.coord.zcoord =
0;<BR> trans->entry.key.location.coord.precision = -1;
//unknown</DIV>
<DIV> </DIV>
<DIV> trans->entry.key.side.length(0); //</DIV>
<DIV> </DIV>
<DIV> //duration, legs, wait<BR> trans->entry.duration
= -1;<BR> trans->entry.legs =
-1;<BR> trans->entry.wait = vTPComp[i];<BR> }</DIV>
<DIV> </DIV>
<DIV> transitions = transitionsT;<BR> <BR> return
API_OK;<BR>}</DIV>
<DIV> </DIV>
<DIV><BR>Best regards<BR>Anders Werholt</DIV>
<DIV> </DIV>
<DIV></FONT> </DIV></BODY></HTML>