Re: CoCreateInstance inside a COM dll?
 
Donos <donguy76@gmail.com> wrote:
I changed the COM code like this,
STDMETHOD GetMyInterface(IMyInterface** pMyInterface, VARIANT_BOOL*
pResult)
{
-------------------------
HRESULT hr = QueryInterface(__uuidof(IMyInterface));
------------------------
Aren't you the least bit put off by the fact that you never use 
pMyInterface parameter (nor, in fact, pResult parameter)? How is the 
result of QueryInterface call supposed to get to the caller? Where is 
the result of QueryInterface call stored in the first place?
I strongly recommend you get a COM textbook, read it, and come back here 
if you still have questions. What you are currently engaged in is called 
shotgun debugging:
http://en.wikipedia.org/wiki/Shotgun_debugging
You just make code changes at random in hopes of accidentally stumbling 
upon the right combination. Besides, you don't seem to actually read, or 
at least promptly ignore once read, any answers to your questions. With 
all due respect, you are wasting both your time and the time of this 
group's participants.
And also the Client code like this,
GetInterface()
{
IMyInterface** pInterface;
HRESULT hr = m_pFirstInterface->GetMyInterface(&pInterface);
I've already told you this is incorrect.
-- 
With best wishes,
    Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925