Click here to Skip to main content
16,011,542 members
Home / Discussions / C#
   

C#

 
QuestionViews Pin
ellllllllie3-Jun-08 0:24
ellllllllie3-Jun-08 0:24 
AnswerRe: Views Pin
leppie3-Jun-08 0:57
leppie3-Jun-08 0:57 
AnswerRe: Views Pin
Ashfield3-Jun-08 1:28
Ashfield3-Jun-08 1:28 
Questionreplace method Pin
kamalesh57433-Jun-08 0:02
kamalesh57433-Jun-08 0:02 
AnswerRe: replace method Pin
leppie3-Jun-08 0:58
leppie3-Jun-08 0:58 
GeneralRe: replace method Pin
kamalesh57433-Jun-08 1:32
kamalesh57433-Jun-08 1:32 
GeneralRe: replace method Pin
leppie3-Jun-08 1:42
leppie3-Jun-08 1:42 
QuestionMulticast Delegates and effect in C++ COM Server Pin
dtranter2-Jun-08 23:45
dtranter2-Jun-08 23:45 
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<t*>(this);
int cConnections = m_vec.GetSize();

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

IDispatch * pConnection = static_cast<idispatch*>(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

QuestioniTextSharp : Select an item in a combobox in PDF file Pin
fady_sayegh2-Jun-08 23:33
fady_sayegh2-Jun-08 23:33 
QuestionCasting to inhering type from inherited type Pin
livez2-Jun-08 23:28
livez2-Jun-08 23:28 
AnswerRe: Casting to inhering type from inherited type Pin
leppie2-Jun-08 23:37
leppie2-Jun-08 23:37 
GeneralRe: Casting to inhering type from inherited type Pin
livez3-Jun-08 0:32
livez3-Jun-08 0:32 
General[Message Deleted] Pin
Jan Scamba3-Jun-08 0:52
Jan Scamba3-Jun-08 0:52 
GeneralRe: Casting to inhering type from inherited type Pin
livez3-Jun-08 1:14
livez3-Jun-08 1:14 
GeneralRe: Casting to inhering type from inherited type Pin
Jan Scamba3-Jun-08 1:22
Jan Scamba3-Jun-08 1:22 
GeneralRe: [Message Deleted] Pin
Scott Dorman3-Jun-08 3:04
professionalScott Dorman3-Jun-08 3:04 
GeneralRe: Casting to inhering type from inherited type Pin
leppie3-Jun-08 1:01
leppie3-Jun-08 1:01 
GeneralRe: Casting to inhering type from inherited type Pin
livez3-Jun-08 1:22
livez3-Jun-08 1:22 
GeneralRe: Casting to inhering type from inherited type Pin
leppie3-Jun-08 1:40
leppie3-Jun-08 1:40 
GeneralRe: Casting to inhering type from inherited type Pin
livez3-Jun-08 1:41
livez3-Jun-08 1:41 
GeneralRe: Casting to inhering type from inherited type PinPopular
leppie3-Jun-08 1:43
leppie3-Jun-08 1:43 
GeneralRe: Casting to inhering type from inherited type Pin
Colin Angus Mackay3-Jun-08 2:30
Colin Angus Mackay3-Jun-08 2:30 
GeneralRe: Casting to inhering type from inherited type Pin
leppie3-Jun-08 3:19
leppie3-Jun-08 3:19 
GeneralRe: Casting to inhering type from inherited type Pin
Colin Angus Mackay3-Jun-08 2:32
Colin Angus Mackay3-Jun-08 2:32 
GeneralRe: Casting to inhering type from inherited type Pin
livez3-Jun-08 3:55
livez3-Jun-08 3:55 

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.