HighTechTalks DotNet Forums  

CComObject back from CComPtr?

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss CComObject back from CComPtr? in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
dsheiner
 
Posts: n/a

Default CComObject back from CComPtr? - 05-08-2009 , 04:26 PM






Suppose I do the following in C++:

STDMETHODIMP CFoo::get_Bar (IBar **outBar)
{

CComObject<CBar> * bar;
CComObject<CBar>::CreateInstance(&bar);

bar->baz= myBaz;

CComPtr<IBar> iBar;
HRESULT hr = bar->QueryInterface(__uuidof(IBar),
reinterpret_cast<void**> (&ibar));
if(SUCCEEDED(hr)) iBar.CopyTo(outBar);
....
}

Now, I have some other function,

STDMETHODIMP CQux::set_Baz(IBar * inBar)
{
....
}

Within this function, I can't set myBaz = inBar->baz. It's not part
of the interface, and baz is of a type I don't think I can name in a
COM function signature (for reference, on the off off chance this
actually helps, it's from the Adobe Acrobat SDK 7.0.5. The type is
ASCab).

Can I create a CComObject instance with access to the baz belonging to
the IBar I'm passing in? Or is there some other way I can get at it?

Thanks,
Daniel Sheiner

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.