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