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

COM

 
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 
Generalpassing connection points parameters by ref Pin
SPENNER1-Dec-01 8:38
SPENNER1-Dec-01 8:38 
Dead | X|
Does anyone know the trick to getting a connection point method to pass parameters by reference? Below is an example of a simple event, which should return a short from the client, but the variant varResult always returns empty?!?

Any ideas?

IDL:
[
uuid(48053E7C-D307-40D2-A380-3B9CB25282AB),
version(1.0),
helpstring("atl_event 1.0 Type Library")
]
library ATL_EVENTLib
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");

[
uuid(224E5ED5-D64E-4556-A785-5ACE0DD8F0B3),
helpstring("_IEventTestEvents Interface")
]
dispinterface _IEventTestEvents
{
properties:
methods:
[id(1), helpstring("method TestEvent")] HRESULT TestEvent([in, out] short* sVar );
};

[
uuid(840EF1AE-F80F-4F71-9802-03DFE6555B19),
helpstring("EventTest Class")
]
coclass EventTest
{
[default] interface IEventTest;
[default, source] dispinterface _IEventTestEvents;
};
};



C++:

template <class t="">
class CProxy_IEventTestEvents : public IConnectionPointImpl<t, &diid__ieventtestevents,="" ccomdynamicunkarray="">
{
//Warning this class may be recreated by the wizard.
public:
HRESULT Fire_TestEvent(SHORT * sVar)
{
CComVariant varResult;
T* pT = static_cast<t*>(this);
int nConnectionIndex;
CComVariant* pvars = new CComVariant[1];
int nConnections = m_vec.GetSize();

for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
{
pT->Lock();
CComPtr<iunknown> sp = m_vec.GetAt(nConnectionIndex);
pT->Unlock();
IDispatch* pDispatch = reinterpret_cast<idispatch*>(sp.p);
if (pDispatch != NULL)
{
VariantClear(&varResult);

pvars[0] = *sVar;

DISPPARAMS disp = { pvars, NULL, 1, 0 };
pDispatch->Invoke(0x1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, &varResult, NULL, NULL);
}
}
delete[] pvars;
// *sVar = varResult.iVal;
return varResult.scode;

}
};

__scott
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 
GeneralRe: Passing SAFEARRAYS through COM events Pin
Rashid Thadha4-Dec-01 10:39
Rashid Thadha4-Dec-01 10:39 

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.