[omniORB] OmniORB304 and Visual Studio .Net Beta 2

Carl Thompson cet@carlthompson.net
Thu, 08 Nov 2001 09:07:22 -0800


The problem might be that you are mixing debug and non-debug standard 
libraries which  doesn't work on VC++.  If the omniORB libraries were linked 
with debug standard libraries (-MTd or -MDd) then your code must also be 
linked with debug standard libraries.  The converse (Inverse? Reverse?) is 
also true.  If you mix them you will get spurious exceptions thrown that 
will drive you insane.

Carl Thompson

Thierry Froux wrote:

> Hi,
> I was experimenting with OmniOrb304 and Visual Studio .Net beta 2 and I 
> came across a small problem.
> For my test I used your Echo sample IDL.
> 
> My project is a c++ console application without mfc or atl or managed 
> c++ support.
> 
> The code generated by omniidl works fine with Visual Studio 6 but .Net 
> throws an Unhandled exception
> exiting the _dispatch method. If I investigate the call stack I can see 
> that the exception occured in
>         msvcr70d.dll -> _CrtIsValidHeapPointer. (Debug Mode)
>         msvcr70.dll -> _CrtIsValidHeapPointer. (Release Mode)
> 
> What I did to correct the problem is change the following in the 
> generated .cc file :
> 
>         original code
>         {
>       CORBA::String_member _0RL_str_tmp;
>       _0RL_str_tmp <<=  giop_s;
>       arg_Name = _0RL_str_tmp._ptr;
>       _0RL_str_tmp._ptr = 0;     
>         }
> 
>         modified code
>         {
>       CORBA::String_member _0RL_str_tmp;
>       _0RL_str_tmp <<=  giop_s;
>       arg_Name = (const char *)_0RL_str_tmp._ptr;
>       _0RL_str_tmp._ptr = 0;     
>         }
> 
> It seems that the operator <<= is not doing what it should do ( a copy 
> of giop_s).
> Its when the stack's trying to get rid of arg_Name that the unhandled 
> exception occured.
> 
> I know that .Net is a beta product... I dont know if this problem is 
> related to a bug in microsoft's code or if
> it is related to a modification in microsoft's code. Or maybe it can be 
> related to a modification in
> microsoft's vc++ project settings.
> 
> Somebody else in my developpement team came across the same problem.
> 
> Anyway... I just tought I'll let you know )
> 
> Thank you
> 
> 
> Thierry Froux
> Senior Developper
> VOXCO inc.
> Montreal, Canada
>