Need help using C# COM from C++ COM

G

Guest

I have a COM object build in C#. I want to use this object in another COM object, built in C++. What's more, I want to return a pointer to the C# COM object from one of the methods of the C++ COM Object. Here's the fragment of my IDL

library BarLi

importlib ("foo.tlb"); // Contains definition of IFoo; generated from C# foo.dl


interface IBa

[id(1), propget] HRESULT GetFoo ([out, retval] IFoo**)
}

MIDL compiler does not like this, it says the IFoo is undefined. One way to get around this would be to create the IDL file for foo.tlb and import that instead of the TLB - can this be done and how? If not, how can I get around that error

Thanks

Dmitry
 
B

Bonj of Beeeeeves

Get the IDL from the OLE object viewer utility.

DmitMF said:
I have a COM object build in C#. I want to use this object in another COM
object, built in C++. What's more, I want to return a pointer to the C# COM
object from one of the methods of the C++ COM Object. Here's the fragment of
my IDL:
library BarLib
{
importlib ("foo.tlb"); // Contains definition of IFoo; generated from C# foo.dll
}

interface IBar
{
[id(1), propget] HRESULT GetFoo ([out, retval] IFoo**);
};

MIDL compiler does not like this, it says the IFoo is undefined. One way
to get around this would be to create the IDL file for foo.tlb and import
that instead of the TLB - can this be done and how? If not, how can I get
around that error?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top