Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / November 2006

Tip: Looking for answers? Try searching our database.

C# App using Mixed Managed C++ crashes when access COM object through interop and unmanged code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ropo - 23 Nov 2006 16:45 GMT
I am using .NET 2.0

I have a C#.Net App, which uses a .NET Class Library, which accesses a
COM object through interop.
The C#.Net App also uses a mixed mode C++.Net Class library which uses
an unmanaged win32 DLL, which uses another unmanaged win32 DLL which
accesses the same COM object

The COM object is in another process.

Problem is When I attempt to access the COM object through both roots
the Application crashes without any messages. I can access the COM
object through either root but not both.

In the c# library I have something like:

LoggerClass _Logger = new LoggerClass() // interop wrapper for com
object

// this is called from the C#.Net app
public CSharp.Interface.Write(string strData)
{
    _Logger.Write(strData);
}

In the C++ Win32 DLL I have something like:

void Write(LPCTSTR strData) // this is call from within another win32
DLL
{
  //  g_Logger is created in the first call using CoCreateInstance
  g_Logger.Write(T2BSTR(strData));
}
ropo - 24 Nov 2006 11:56 GMT
Thankfully this was not a conceptual problem but due to my own
incompedence. I had a problem where I was overwriting memory.

> I am using .NET 2.0
>
[quoted text clipped - 29 lines]
>    g_Logger.Write(T2BSTR(strData));
> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.