[omniORB] Pb with string in structure

Eric Callier eric.callier@elftrading.com
Mon, 14 Aug 2000 12:59:01 +0200


hello,

I'm new to omniORB3, I use VC6 (sp4).

It seem that I miss understand the omniORB string_member manipulation or
there is  a strange behaviour in VC6 because :

When I try to put a string member in an idl structure VC raise an assertion
error when it try to delete the structure.
When I replace the string type by an any type (in which I put a string)
every thing work fine !

Follow my code:

// my idl
  struct Session
  {
  ......
   string                     domaine;
 .......
  };

  interface SessionManager
  {
  .....
   boolean     addSession(inout Session session)
raises(myException::SessionException);
  ......
 };

////////////////////

Version 1:

bool SessionManager_impl::addSession(Session& session)
{
     fprintf(stdout,"Register Client in %s\n",session.domaine);
}
 // VC return an assertion error here when try to delete the string
session.domaine;
// DBGHEAP.C line 1044:       _ASSERTE(_CrtIsValidHeapPointer(pUserData));
//data in use


////////////////////

Version 2:

bool SessionManager_impl::addSession(Session& session)
{
     fprintf(stdout,"Register Client in %s\n",session.domaine);
     session.domaine = (const char*)"test";  //fail on omni::freeString
(_ptr); //data in use
}


Is someone can help me ?

Thanks,

Eric CALLIER