Truckle, Andrew J wrote:
> Please confirm for me, as I am unsure here.
>
> I have this member variable:
>
> CComQIPtr <Outlook::_Application <Outlook::_Application> >
> m_spApp;
Ah, that's a typo, right? I assume you mean:
CComQIPtr< Outlook::_Application > m_spApp;
> I want to pass this into a dialogue, so that the dialogue can use it.
>
> What type of variable should be in the dialogue class, and what should be
> the parameter declaration of the method passing in the variable?
Depends on whether you want the pointer to be managed by smart pointers
in the dialog method (recommended) or not. The solutions to those two
cases are like below, respectively:
class dialog1 {
void foo(CComQIPtr< Outlook::_Application > sp);
};
class dialog2 {
void foo(Outlook::_Application * p);
};
// to call it
dialog1 d1;
d1.foo( m_spApp );
dialog2 d2;
d2.foo( m_spApp.p );
--
Ehsan Akhgari
Farda Technology <http://www.farda-tech.com/>
There are 10 types of people in this world; those who can count in binary...
_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for
subscription changes, and list archive.