That did the trick. Thanks a lot!
eero_p
Posts
-
COM event firing to multiple targets -
COM event sinkSorry about that. It is sometimes a bit tricky to dig up the correct terms, when you get a new tool in your right hand and task to do in your left. Some sort of guidance on the tool and terminology would be optimal, but unfortunately in this case there were none. Example would have helped a lot. However, you guessed just fine, and that gives me nice keywords to hit into the google search-field. Thanks!
-
COM event sinkNo errors, just don't know how can I make the sink object 'see' the main form or its controls. Here's the sink that is created in: public __gc class Form1 : public System::Windows::Forms::Form -style form. Connecting to COM and reveiving an event is no problem, but how do I pass the parameter received in 'OnEvent' into a control on the form? #ifndef __SINKBASE #define __SINKBASE #include #include #import "xxx.dll" named_guids raw_interfaces_only #include "xxx.h" template class SinkBase : public IDispEventSimpleImpl { public: SinkBase() { } // fill in the _ATL_FUNC_INFO structured depending on DISPID virtual HRESULT GetFuncInfoFromId(const IID& iid, DISPID dispidMember, LCID lcid, _ATL_FUNC_INFO& info)=0; }; class MySink : public SinkBase<0, MySink, &DIID__IxxxEvents> { public: MySink() { } BEGIN_SINK_MAP(MySink) SINK_ENTRY_EX(0, DIID__IxxxEvents, 1, OnEvent) END_SINK_MAP() HRESULT GetFuncInfoFromId(const IID& iid, DISPID dispidMember, LCID lcid, _ATL_FUNC_INFO& info) { if (InlineIsEqualGUID(iid, DIID__IxxxEvents)) { info.cc = CC_STDCALL; switch(dispidMember) { case 1: info.vtReturn = VT_I4; info.nParams = 1; info.pVarTypes[0] = VT_BSTR; return S_OK; default: return E_FAIL; } } return E_FAIL; } HRESULT __stdcall OnEvent(BSTR eventString) { return S_OK; } };
-
COM event sinkHow can one implement a COM event sink with 'Windows Forms Application' with .NET 2005? Found plenty of examples on how to do it using MFC, but no luck witn CLI yet. Anyone solved this tricky operation yet? I managed to implement one solution with 2003-version (it's not using CLR:pure or :safe, but CLR:oldformat), yet a problem exists on how to tell the Forms application the parameters (i.e. how to display the received parameters in controls).
-
COM event firing to multiple targetsCreating a COM dll -module that fires events is simple enough (ATL -project -> add ATL simple object with Connection point -support -> Add a couple methods etc.), but: What flags are needed for multiple instances to catch the same event when it is fired? I.e. when I CoCreateInstanceEx a connection to module from let's say 2 separate exe's, both can receive the same event. Tried quite a few combinations so far and yet no success.
-
remote loginHello! Is there an existing program that can handle login to remote computer automatically (i.e. with one click) with HP iPAQ? Remote terminal server always requires normal windows login after connecting to remote computer. What I'd like to have, is that to happen automatically just like windows remote desktop connection can be configured.
-
tary icon popup textSo, what would be the better way?
-
tary icon popup textHello! I found several examples on how to create applications that use tray icons. However, didn't find what I really need. How can I (if at all possible) enumerate all existing tray icons and read their popup (hint) text? That would be especially useful, e.g. if I have a probe application in tray that shows temperature or whatever on its popup text and I want to use that in my own application. Thanks in advance!