Re: CoCreateInstance inside a COM dll?
Am sorry for the total mess up with the code. While typing i missed
some important parts of the code, its not that those pieces of code
are not in the original.
Here i go with the proper code again,
STDMETHOD GetMyInterface(IMyInterface** pMyInterface)
{
-------------------------
HRESULT hr = QueryInterface(__uuidof(IMyInterface), (void **)
pMyInterface);
------------------------
}
And also the Client code like this,
GetInterface()
{
IMyInterface** pInterface;
HRESULT hr = m_pFirstInterface->GetMyInterface(pInterface);
}
Another thing is the interfaces are inherited here,
Like,
interface IFirstInterface : IUnknown{};
interface ISecondInterface : IFirstInterface {};
interface IMyInterface : ISecondInterface {};
interface ITopInterface : IUnknown {};
interface IClientInterface : ITopInterface {};
This is the inheritance structure of interfaces in COM IDL file.
I am trying to QueryInterface the IMyInterface from inside
IClientInterface.
Hope this helps in getting a better understanding of what am trying
to do.
So any guesses about the error am getting?
It's an Unhandled Exception.