problems between IONA and MFC

problems between IONA and MFC

Post by Ozren Vojvodi » Thu, 05 Jul 2001 05:00:54



Hello,

I created a client using ORBIX2000 Client/Server wizard but later included
(relevant) generated files into an MFC application adding all necessary
Orbix libraries, link and compiler options (those that Client/Server wizard
used). Problem is that while Release version of my application compiles and
runs without problems, Debug version performs illegal operation when CORBA
objects used for initialization of ORB and obtaining IORs from naming
service (usual initialization procedure) run out of scope. Is this a known
problem? I'm sorry if I wasn't clear enough.

 
 
 

problems between IONA and MFC

Post by Bill Lloy » Thu, 05 Jul 2001 02:30:03


Hi Ozren,

If you compile as debug multithreaded dll (/MDd), then Microsoft uses
different heap management DLL's.  This causes problems with libraries which
don't account for this (I don't remember exactly what's going on, but memory
allocated and deallocated in different DLL's I think is a problem).

At any rate, you need to ensure you are using the /MD compiler flag in *all*
cases -- use this in your debug *and* release builds (you can specify this
in the environment).

Orbix 2000 2.0 will be changing some things, and as such it should be able
to be built with the /MDd flag without problems.  It should be shipping in
August or September.

Cheers,

-Bill


Quote:> Hello,

> I created a client using ORBIX2000 Client/Server wizard but later included
> (relevant) generated files into an MFC application adding all necessary
> Orbix libraries, link and compiler options (those that Client/Server
wizard
> used). Problem is that while Release version of my application compiles
and
> runs without problems, Debug version performs illegal operation when CORBA
> objects used for initialization of ORB and obtaining IORs from naming
> service (usual initialization procedure) run out of scope. Is this a known
> problem? I'm sorry if I wasn't clear enough.


 
 
 

problems between IONA and MFC

Post by Bernard Normie » Thu, 05 Jul 2001 11:15:56


Quote:> If you compile as debug multithreaded dll (/MDd), then Microsoft uses
> different heap management DLL's.  This causes problems with libraries
which
> don't account for this (I don't remember exactly what's going on, but
memory
> allocated and deallocated in different DLL's I think is a problem).

When compiling with /MDd, VC++ overrides the global new and delete
operators to allocate/deallocate extra memory.
As a result if you create an object in a /MD built module and delete
this object in a /MDd module (which occurs frequently with the IDL
to C++ mapping), you get a crash.

To avoid this problem, Orbix 2000 2.0 uses consistently new, new[],
delete, delete[] (...) allocation and deallocation functions for all mapped
C++ classes; these functions are all implemented in the same shared
library (the art dll), built with /MD.

If you use iostreams (e.g. to display system exceptions), this mixing
of /MDd and /MD works only with the classic iostreams (<iostream.h>
etc.) ... Orbix 2000 2.0 also supports both standard and classic iostreams
on Windows/VC++6.

Cheers,

Bernard