Hi,
I tried to implement the events delegation using "UCOMIConnectionPoint":
/////////////////////////////////////////////////////////////////
UCOMIConnectionPoint mCnnctPt;
int mCookie;
UCOMIConnectionPointContainer CnnctPtCont =
(UCOMIConnectionPointContainer)MyApp;
MyAppEvents PES = new MyAppEvents();
Guid guid = new Guid("44E333BB-F4FA-11D3-B77C-001111CCAE9F");
CnnctPtCont.FindConnectionPoint(ref guid, out mCnnctPt);
mCnnctPt.Advise(PES, out mCookie);
/////////////////////////////////////////////////////////////////
when "MyAppEvents" is a class which inherits from an event interface.
This worked when the client (c# program) was inproc. (written as a DLL).
but it did not work when the client program was out-of-proc (written as
EXE).
Is there a problem of using UCOMIConnectionPoint out-of-proc ?
"Clive Dixon" <clived at digita dot comwrote in message
news:ek**************@TK2MSFTNGP04.phx.gbl...
No, there is not an equivalent. In C# if you want to raise events from
outside the class you will need to define public methods in the class
which raise events. (I'm assuming from VB examples that I've seen that
using 'WithEvents' allows access to private methods which raise events,
but I stand to be corrected on this.)
"Yoavo" <yo**@cimatron.co.ilwrote in message
news:ei****************@TK2MSFTNGP05.phx.gbl...
>Hi,
Is there an equivalent code for "WithEvents" (of VB6) in CSharp ?
Yoav.