Click here to Skip to main content
15,891,633 members
Home / Discussions / COM
   

COM

 
GeneralRe: Launching multiple IE Pin
Nirav Doshi13-Jun-08 20:14
Nirav Doshi13-Jun-08 20:14 
GeneralRe: Launching multiple IE Pin
Jörgen Sigvardsson13-Jun-08 22:14
Jörgen Sigvardsson13-Jun-08 22:14 
GeneralRe: Launching multiple IE Pin
Nirav Doshi14-Jun-08 2:06
Nirav Doshi14-Jun-08 2:06 
QuestionDetect Network Adapters in Borland C++ Builder Pin
Nekt Chrono4-Jun-08 21:54
Nekt Chrono4-Jun-08 21:54 
QuestionExcel WorkbookBeforeClose event Document Proof Pin
HarishKumarS4-Jun-08 4:37
HarishKumarS4-Jun-08 4:37 
Questionpass a parameter to a com+ application Pin
Ayman Mashal4-Jun-08 0:19
Ayman Mashal4-Jun-08 0:19 
QuestionCOM and Inteface/Implementation Polymorphism Pin
kimutley3-Jun-08 10:02
kimutley3-Jun-08 10:02 
Questionc# delegates and effect on c++ com server Pin
dtranter3-Jun-08 1:06
dtranter3-Jun-08 1:06 
Hello

I am using multicast delegate as follows, but the effect in the server is undesirable:

Thing.OnEvent1 += new IThingEvents_OnEvent1EventHandler(OnEvent1);
Thing.OnEvent2 += new IThingEvents_OnEvent2EventHandler(OnEvent2);
Thing.OnEvent3 += new IThingEvents_OnEvent3EventHandler(OnEvent3);

The problem is that the (C++ COM) server it thinks it has all the connections for each event.
So in the below example it trys to send the event 3 times. Apart from the unecessary processing, I am worried it is making the inter-process call each time (the incorrect calls are being thrown away on the client side somewhere).

HRESULT Fire_OnOrderCancel(lots of params)
{
HRESULT hr = S_OK;
T * pThis = static_cast(this);
int cConnections = m_vec.GetSize();

for (int iConnection = 0; iConnection < cConnections; iConnection++)
{
pThis->Lock();
CComPtr punkConnection = m_vec.GetAt(iConnection);
pThis->Unlock();

IDispatch * pConnection = static_cast(punkConnection.p);

if (pConnection)
{
CComVariant avarParams[20];
//set avarParams
CComVariant varResult;

DISPPARAMS params = { avarParams, NULL, 9, 0 };
hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, ¶ms, &varResult, NULL, NULL);
}
}
return hr;
}

What c# thing do I need to use to get the desired behaviour, namely events to be fired once and the c# client to do the correct delegation?

Many Thanks

deds

QuestionGetting the Physical File Name of a Spreadsheet Pin
Brendan Vogt2-Jun-08 1:06
Brendan Vogt2-Jun-08 1:06 
AnswerRe: Getting the Physical File Name of a Spreadsheet Pin
Vi26-Jun-08 0:24
Vi26-Jun-08 0:24 
QuestiondirectX with webcam Property Pin
mmvv2-Jun-08 0:06
mmvv2-Jun-08 0:06 
QuestionCoInitialize permissions for windows service Pin
rana741-Jun-08 19:12
rana741-Jun-08 19:12 
AnswerRe: CoInitialize permissions for windows service Pin
rana742-Jun-08 16:04
rana742-Jun-08 16:04 
GeneralRe: CoInitialize permissions for windows service Pin
vipin.vjayan6-Oct-20 4:04
vipin.vjayan6-Oct-20 4:04 
QuestionHow to make the ActiveX control full transparent in word Pin
liuguang1-Jun-08 17:01
liuguang1-Jun-08 17:01 
QuestionUsing IFileOpenDialog in C# Pin
jonesap530-May-08 5:49
jonesap530-May-08 5:49 
AnswerRe: Using IFileOpenDialog in C# Pin
Mike Dimmick2-Jun-08 7:09
Mike Dimmick2-Jun-08 7:09 
AnswerRe: Using IFileOpenDialog in C# Pin
capcom92319-Jul-11 22:25
capcom92319-Jul-11 22:25 
QuestionProblem with COM objects used to replicate data from lotus notes to SQL Pin
madhuGM29-May-08 6:06
madhuGM29-May-08 6:06 
Questionhow selective loading BHO in Chtmlview environment Pin
ftbk27-May-08 16:29
ftbk27-May-08 16:29 
Answer[Cross Post]Re: how selective loading BHO in Chtmlview environment Pin
Scott Dorman27-May-08 17:24
professionalScott Dorman27-May-08 17:24 
QuestionCompiling a VC++ 6.0 project with VC++ 7.1 problem: Error C2664 with CComPtr. Please help. Pin
Arris7426-May-08 3:19
Arris7426-May-08 3:19 
AnswerRe: Compiling a VC++ 6.0 project with VC++ 7.1 problem: Error C2664 with CComPtr. Please help. Pin
Mike Dimmick28-May-08 7:20
Mike Dimmick28-May-08 7:20 
QuestionOLE Compound Document - File Drag Drop Pin
sunil_963125-May-08 23:36
sunil_963125-May-08 23:36 
QuestionL"" Pin
bulg23-May-08 12:35
bulg23-May-08 12:35 

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.