Interoperability issue: .net from COM

Aug 2 2004 5:20 AM
Hi, I have a .NET class library project which i registered for COM interop. Inside this .NET dll i have used one COM component (third party). While writing code for the class library I made sure to fulfill all the requirements for the CCW (made interface, classes are public etc.). When I call a simple function (Add, Sub etc) which does not in turn call third party COM component or any other COM dll, it works fine. But when I call the function which is using the third party com component or any com dll from inside, it gives runtime error. My COM client is VC++ (MFC). The error says "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.". Here is my client code (VC++): IImageCompressorPtr ptrImageCompressor = NULL; hr = ptrImageCompressor.CreateInstance(_uuidof(ImageCompressor)); int filesize = ptrImageCompressor->SayHello(20); //this line gives error SayHello function in .net uses one image compression library to compress an image. When I comment this line it works fine. I am able to call this function successfully from VB 6.0 (std exe project). And ofcourse, from .net client (winforms project). Anybody have any clues???? Thanks in advance.