none
OracleConnection throws EEMessageException in managed C++ RRS feed

  • Question

  • I have an native C++ app which needs to connect to an Oracle DB. Oracle data layers written in  C#.Net so was hoping to reuse the code as a dll.    I decided to try using managed C++ to bridge the gap between native C++ and C#.  The managed C++  adaptor layer works fine (almost).  The unmanaged C++ exe can invoke various classes and methods in the C# just fine.
    Except for System.Data.OracleClient.OracleConnection which of course is the really important one.
    When I call Open() on it  EEMessageException is thrown.  I am using Oracle 9 on Windows xp.
    My C# data object dll works fine when invoked from a C# exe.
    So I think it has some sort of issue with loading an assembly or an issue with the oracle driver into an native process hosting the CLR in a dll.   

    Here is the C# dll working fine in a normal C# app.
    ………………
    'OracleTest.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'OracleTest.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.Transactions\2.0.0.0__b77a5c561934e089\System.Transactions.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    'OracleTest.vshost.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
    ………………


    Here it is exploding in the native C++ app calling through an managed C++ layer

    'QFeedTest.exe': Loaded 'C:\app\Oracle\bin\oci.dll', Binary was not built with debug information.
    First-chance exception at 0x7c812afb in MyUnmanagedCPP.exe: Microsoft C++ exception: EEMessageException at memory location 0x0012d014..

    Is there any setting can do to get the it load the Oracle driver correctly?


    Friday, May 22, 2009 12:55 AM

All replies

  • No sign of anything exploding.  A first-chance exception is pretty common.  If that's all you see, the exception was caught and handled.

    Hans Passant.
    Friday, May 22, 2009 12:34 PM
    Moderator