Click here to Skip to main content
15,912,507 members
Home / Discussions / COM
   

COM

 
GeneralActiveX Pin
mazy4-Dec-01 2:57
mazy4-Dec-01 2:57 
GeneralDllSurrogate problems Pin
Avneesh Bhatnagar3-Dec-01 18:38
Avneesh Bhatnagar3-Dec-01 18:38 
GeneralRe: DllSurrogate problems Pin
Joao Morais5-Jan-02 0:36
Joao Morais5-Jan-02 0:36 
GeneralQueryInterface( ..., void** ppv) Pin
3-Dec-01 9:26
suss3-Dec-01 9:26 
GeneralRe: QueryInterface( ..., void** ppv) Pin
Bill Wilson3-Dec-01 10:45
Bill Wilson3-Dec-01 10:45 
GeneralRe: QueryInterface( ..., void** ppv) Pin
Shadi Al-Kahwaji9-Dec-01 22:41
Shadi Al-Kahwaji9-Dec-01 22:41 
GeneralAutomatisation question - need hint Pin
Harald Krause2-Dec-01 6:25
Harald Krause2-Dec-01 6:25 
GeneralRe: Automatisation question - need hint Pin
David Stranz3-Dec-01 6:53
David Stranz3-Dec-01 6:53 
You create the other COM object with an IDispatch-derived interface, then return that IDispatch pointer as the [out, retval] parameter to the call.

Example from one of my controls (an X-Y data plot - IAxis is the COM object I want to return):

-> IDL:

[
object,
uuid( /* GUID */),
dual,
helpstring("IDataplot Interface"),
pointer_default(unique),
nonextensible
]
interface IDataplot : IDispatch
{
/* ... */

[ propget,
id(5),
helpstring("property AxisX")]
HRESULT AxisX(
[out, retval] IAxis * * ppVal );
}

-> C++ .h file:

STDMETHOD(get_AxisX)(/*[out, retval]*/ IAxis * * ppVal );

-> C++ .cpp file:

STDMETHODIMP CDataplot::get_AxisX( IAxis * * ppVal )
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())

if ( 0 == ppVal )
return E_POINTER;
*ppVal = 0;

HRESULT hRes = S_OK;
CComObject< CAxis > * pObj = 0;
try
{
hRes = CComObject< CAxis >::CreateInstance( &pObj );
if ( SUCCEEDED( hRes ) )
{

hRes = pObj->QueryInterface( IID_IAxis, (void * *)ppVal );


assert( SUCCEEDED( hRes ) );
}
}
catch( ... )
{
hRes = E_OUTOFMEMORY;
*ppVal = 0;
}
return hRes;
}


I hope this is legible - the message editor on this site is less than adequate for replying. Whose bright idea was it to set the width of the editing window to 20 characters, with automatic wrapping?

Regards,

David
Generalpassing connection points parameters by ref Pin
SPENNER1-Dec-01 8:38
SPENNER1-Dec-01 8:38 
GeneralRe: passing connection points parameters by ref Pin
Anders Molin1-Dec-01 10:56
professionalAnders Molin1-Dec-01 10:56 
GeneralRe: passing connection points parameters by ref Pin
SPENNER1-Dec-01 11:38
SPENNER1-Dec-01 11:38 
GeneralRe: passing connection points parameters by ref Pin
Anders Molin1-Dec-01 12:50
professionalAnders Molin1-Dec-01 12:50 
GeneralRe: passing connection points parameters by ref Pin
Michael P Butler2-Dec-01 1:54
Michael P Butler2-Dec-01 1:54 
GeneralRe: passing connection points parameters by ref Pin
SPENNER2-Dec-01 9:51
SPENNER2-Dec-01 9:51 
GeneralRe: passing connection points parameters by ref Pin
Anders Molin2-Dec-01 10:55
professionalAnders Molin2-Dec-01 10:55 
GeneralRe: passing connection points parameters by ref Pin
SPENNER4-Dec-01 7:56
SPENNER4-Dec-01 7:56 
GeneralRe: passing connection points parameters by ref Pin
Anders Molin4-Dec-01 8:11
professionalAnders Molin4-Dec-01 8:11 
GeneralUsing ActiveX Object inside ATL COM Object... Please Help Pin
Matt Philmon30-Nov-01 18:37
Matt Philmon30-Nov-01 18:37 
GeneralWinXP Pin
Gfw30-Nov-01 2:39
Gfw30-Nov-01 2:39 
QuestionHow to version an ActiveX dll? Pin
David Stranz29-Nov-01 13:19
David Stranz29-Nov-01 13:19 
GeneralActiveX & Threads...gettin' Funky - Check this Out. Pin
Tim Rymer28-Nov-01 11:29
Tim Rymer28-Nov-01 11:29 
GeneralRe: ActiveX & Threads...gettin' Funky - Check this Out. Pin
Anders Molin30-Nov-01 23:40
professionalAnders Molin30-Nov-01 23:40 
GeneralRe: ActiveX & Threads...gettin' Funky - Check this Out. Pin
Ali Issa6-Dec-01 3:34
Ali Issa6-Dec-01 3:34 
GeneralVB Client: can't see inner aggregated COM object interface Pin
28-Nov-01 5:36
suss28-Nov-01 5:36 
GeneralPassing SAFEARRAYS through COM events Pin
Rick Dangerous28-Nov-01 2:07
Rick Dangerous28-Nov-01 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.