[omniORB] Problem of CORBA::String in MFC Application

Jeffrey Du jeffdu@163.net
Sun, 5 Dec 1999 12:26:21 +0800


This is a multi-part message in MIME format.

------=_NextPart_000_001D_01BF3F1B.EFF15260
Content-Type: text/plain;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable

   I am writing a CORBA program in VC++ 5.0 using omniORB 2.8 in =
Windows95. I find that
any functions in my program using CORBA::String will encounter an error =
when they return.
For example, here is my code of the function:
=20
int CWSInfoApp::InitCorbaServer()
{
   ......=20
   CORBA::String_var p =3D orb->object_to_string(myobj);
   ......=20
=20
   return(0); // an error occurs after return
}
=20
   And the error message is:
=20
   Microsoft Visual C++ Debug Library
        Debug Assertion Failed
        Program:  .....
        File: dbgdel.cpp
        Line: 47
        Exception: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)
=20
   I think the error occurs when releasing CORBA::String memory.=20
   Please tell me how to solve this problem.
=20
   Jeffrey Du
   jeffdu@163.net

------=_NextPart_000_001D_01BF3F1B.EFF15260
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content=3Dtext/html;charset=3Dgb2312 http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#c0c0c0>
<DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; I am writing a CORBA =
program in=20
VC++ 5.0 using omniORB 2.8 in Windows95. I find that</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>any functions in my program using =
CORBA::String=20
will encounter an error when they return.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>For example, here is my code of the=20
function:</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>int =
CWSInfoApp::InitCorbaServer()</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT><FONT size=3D2>{</FONT></DIV>
<DIV><FONT size=3D2>&nbsp;&nbsp; ......</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; CORBA::String_var p =3D =

orb-&gt;object_to_string(myobj);</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; =
......</FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; return(0); // an error =
occurs after=20
return</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT><FONT color=3D#000000 =
size=3D2>}</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; And the error message=20
is:</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; Microsoft Visual C++ =
Debug=20
Library</FONT></DIV>
<DIV><FONT color=3D#000000 =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Debug=20
Assertion Failed</FONT></DIV>
<DIV><FONT color=3D#000000 =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Program:&nbsp; .....</FONT></DIV>
<DIV><FONT color=3D#000000 =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File:=20
dbgdel.cpp</FONT></DIV>
<DIV><FONT color=3D#000000 =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Line:=20
47</FONT></DIV>
<DIV><FONT color=3D#000000 =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Exception: _BLOCK_TYPE_IS_VALID(pHead-&gt;nBlockUse)</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; I think the error =
occurs when=20
releasing CORBA::String memory. </FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; Please tell me how to =
solve this=20
problem.</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; Jeffrey Du</FONT></DIV>
<DIV><FONT color=3D#000000 size=3D2>&nbsp;&nbsp; <A=20
href=3D"mailto:jeffdu@163.net">jeffdu@163.net</A></FONT></DIV></DIV></BOD=
Y></HTML>

------=_NextPart_000_001D_01BF3F1B.EFF15260--