Click here to Skip to main content
15,903,033 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: RE: Help Pin
Jörgen Sigvardsson18-Aug-03 13:07
Jörgen Sigvardsson18-Aug-03 13:07 
GeneralAbout ATL/WTL Pin
HansonDavid16-Aug-03 23:41
HansonDavid16-Aug-03 23:41 
GeneralRe: About ATL/WTL Pin
Michael Dunn17-Aug-03 7:20
sitebuilderMichael Dunn17-Aug-03 7:20 
GeneralRe: About ATL/WTL Pin
HansonDavid18-Aug-03 1:01
HansonDavid18-Aug-03 1:01 
QuestionHow to convert from .DOC to .PDF, please help me .......... Pin
Atif Bashir16-Aug-03 1:47
Atif Bashir16-Aug-03 1:47 
QuestionHow can I send a reference of an object in a event? Pin
emoscosocam13-Aug-03 13:49
emoscosocam13-Aug-03 13:49 
AnswerRe: How can I send a reference of an object in a event? Pin
valikac14-Aug-03 6:42
valikac14-Aug-03 6:42 
GeneralRe: How can I send a reference of an object in a event? Pin
emoscosocam14-Aug-03 8:38
emoscosocam14-Aug-03 8:38 
Thanks a lot for your reply.

Here is what I intend to do: I have a Component with 2 Classes: ObjectSender and ObjectToBeSent. ObjectSender has one event: SendObject(IObjectToBeSent **pObject). My idea is to pass a reference of ObjectToBeSent to a Visual Basic client. However, when calling the Invoke method of the client, pVarResult returns an error; so the VB client does not execute its event handler.

In other words, I do not know how to send a reference of a COM object by using IDispatch::Invoke(). Can you please help me?

HRESULT Fire_SendObject()
{
...
CComVariant* pvars = new CComVariant[1];
CComObject<cobjecttobesent> *pObjectToBeSent;
IObjectToBeSent *pIObjectToBeSent;
CComObject<cobjecttobesent>::CreateInstance(&pObjectToBeSent);
pObjectToBeSent->QueryInterface(
IID_IObjectToBeSent, (void **)&pIObjectToBeSent);

....

for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++)
{
....
pvars[0] = pIObjectToBeSent;
pvars[0].vt = VT_UNKNOWN | VT_BYREF;
pvars[0].ppunkVal = (IUnknown **)&pIObjectToBeSent;
...
hr=pDispatch->Invoke(...) // This does not work
...
}
}

Thanks again for your kind attention.
GeneralRe: How can I send a reference of an object in a event? Pin
Jörgen Sigvardsson18-Aug-03 13:10
Jörgen Sigvardsson18-Aug-03 13:10 
GeneralRe: How can I send a reference of an object in a event? Pin
Jörgen Sigvardsson18-Aug-03 13:09
Jörgen Sigvardsson18-Aug-03 13:09 
GeneralRe: How can I send a reference of an object in a event? Pin
valikac18-Aug-03 17:50
valikac18-Aug-03 17:50 
GeneralI hate ActiveX Pin
Mauricio Ritter12-Aug-03 4:19
Mauricio Ritter12-Aug-03 4:19 
GeneralRe: I hate ActiveX Pin
Stephane Rodriguez.12-Aug-03 4:40
Stephane Rodriguez.12-Aug-03 4:40 
GeneralRe: I hate ActiveX Pin
Mauricio Ritter12-Aug-03 5:30
Mauricio Ritter12-Aug-03 5:30 
GeneralRe: I hate ActiveX Pin
Stephane Rodriguez.12-Aug-03 6:21
Stephane Rodriguez.12-Aug-03 6:21 
GeneralRe: I hate ActiveX Pin
Michael Dunn15-Aug-03 19:13
sitebuilderMichael Dunn15-Aug-03 19:13 
Generalc++ template compile error c2975 Pin
i--11-Aug-03 22:52
i--11-Aug-03 22:52 
GeneralRe: c++ template compile error c2975 Pin
geo_m12-Aug-03 1:24
geo_m12-Aug-03 1:24 
GeneralRe: c++ template compile error c2975 Pin
i--12-Aug-03 2:32
i--12-Aug-03 2:32 
GeneralRe: c++ template compile error c2975 Pin
i--12-Aug-03 2:34
i--12-Aug-03 2:34 
GeneralSTL - lower_bound() w/vector of pointers Pin
pfoo11-Aug-03 8:31
pfoo11-Aug-03 8:31 
Generalnevermind Pin
pfoo11-Aug-03 9:05
pfoo11-Aug-03 9:05 
GeneralRe: nevermind Pin
Jörgen Sigvardsson12-Aug-03 13:47
Jörgen Sigvardsson12-Aug-03 13:47 
Questiondebug assertions : wierd or not?? Pin
Senkwe Chanda6-Aug-03 8:44
Senkwe Chanda6-Aug-03 8:44 
Answerjust me being stupid Pin
Senkwe Chanda6-Aug-03 13:46
Senkwe Chanda6-Aug-03 13:46 

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.