<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[COM Events]]></title><description><![CDATA[<p>Hallo,</p>
<p>weiß jemand wie COM Events mit Borland abgefangen und/oder erzeugt werden können?<br />
Sprich wie COM implimentiert werden kann?<br />
Bin für jeden Hinweis dankbar!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/117593/com-events</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Jul 2026 15:08:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/117593.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 09 Aug 2005 09:53:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to COM Events on Tue, 09 Aug 2005 09:53:03 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>weiß jemand wie COM Events mit Borland abgefangen und/oder erzeugt werden können?<br />
Sprich wie COM implimentiert werden kann?<br />
Bin für jeden Hinweis dankbar!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848562</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848562</guid><dc:creator><![CDATA[Clip]]></dc:creator><pubDate>Tue, 09 Aug 2005 09:53:03 GMT</pubDate></item><item><title><![CDATA[Reply to COM Events on Tue, 09 Aug 2005 10:48:51 GMT]]></title><description><![CDATA[<p>Hallo,<br />
verrate uns doch bitte ob du für COM-Anwendungen oder für die seriellen COM etwas Unterstützung haben möchtest.</p>
<p>evi48</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848605</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848605</guid><dc:creator><![CDATA[evi48]]></dc:creator><pubDate>Tue, 09 Aug 2005 10:48:51 GMT</pubDate></item><item><title><![CDATA[Reply to COM Events on Tue, 09 Aug 2005 10:52:06 GMT]]></title><description><![CDATA[<p>nun gut <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
ich dachte mehr an COM-Anwendungen.....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848607</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848607</guid><dc:creator><![CDATA[Clip]]></dc:creator><pubDate>Tue, 09 Aug 2005 10:52:06 GMT</pubDate></item><item><title><![CDATA[Reply to COM Events on Wed, 10 Aug 2005 05:28:22 GMT]]></title><description><![CDATA[<p>Guten Morgen Clip,<br />
tut mir leid da kann ich dir nicht weiter helfen habe bisher noch nichts mit COM-Anwendungen zu tun gehabt. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>Viel Erfolg<br />
evi48</p>
]]></description><link>https://www.c-plusplus.net/forum/post/849075</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/849075</guid><dc:creator><![CDATA[evi48]]></dc:creator><pubDate>Wed, 10 Aug 2005 05:28:22 GMT</pubDate></item><item><title><![CDATA[Reply to COM Events on Thu, 11 Aug 2005 09:37:40 GMT]]></title><description><![CDATA[<p>Ich habe folgendes im Netz gefunden:<br />
<a href="http://64.233.183.104/search?q=cache:i_RAdvAiYQ0J:bdn.borland.com/article/0,1410,26734,00.html+sink+COM+Event+Borland&amp;hl=de" rel="nofollow">http://64.233.183.104/search?q=cache:i_RAdvAiYQ0J:bdn.borland.com/article/0,1410,26734,00.html+sink+COM+Event+Borland&amp;hl=de</a><br />
Impl.cpp</p>
<pre><code class="language-cpp">STDMETHODIMP TTestEventsImpl::Trigger()
{
  //fire off our event
  Fire_Event1(WideString(&quot;Mesage message message message!&quot;));
  return S_OK;
}
</code></pre>
<p>unit.h</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
class TForm1; //forward ref to TForm1

//here we derive from TEventDispatcher specialized on our class
//and the dispatch ID of the event interface
class EventHandler:
  public TEventDispatcher&lt;EventHandler,&amp;DIID_ITestEventsEvents&gt;
{
private:
  bool connected;
  TForm1 *theform;
  ITestEventsPtr server;
protected:
  //overloaded from TEventDispatcher.
  HRESULT InvokeEvent(DISPID id, TVariant *params);

public:

  EventHandler();
  ~EventHandler();

  void Connect(TForm1 *form, ITestEventsPtr srv);
  void Disconnect();

  void __fastcall HandleEvent1(BSTR Message);

};
#endif
</code></pre>
<p>unit.cpp</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;

//---------------------------------------------------------------------------

#pragma package(smart_init)

EventHandler::EventHandler()
{
  connected = false; //not connected;
  theform = false; //backptr to form is null
}

EventHandler::~EventHandler()
{
  if (connected)
    Disconnect();
}

/*
Here we do a switch on the DISPID (can be gotten from the type library).
params is an array of TVariant's. These we delegate to our event handlers.
*/
HRESULT EventHandler::InvokeEvent(DISPID id, TVariant *params)
{
  switch(id)
  {
    case 1:
        HandleEvent1(WideString(*params));
      break;
    default:
      ShowMessage(&quot;we shouldn't be here!&quot;);
  }
}

/*
This function attaches our event handler to a running instance of the server.
This is the method that actually sinks our events.
*/
void EventHandler::Connect(TForm1 *form, ITestEventsPtr srv)
{
  server = srv;
  theform = form; //back pointer to form to do stuff with it.
  server-&gt;AddRef(); //addref the server
  ConnectEvents(server); //helper function to connect us 
			//to the events interface
}

void EventHandler::Disconnect()
{
  DisconnectEvents(server);   //disconnect the events
  server-&gt;Release();          //release our referece
}

/* here we actually handle the event in any way we want */
void __fastcall EventHandler::HandleEvent1(BSTR Message)
{
  theform-&gt;Label1-&gt;Caption = WideString(Message);
}
</code></pre>
<p>Mir ist jedoch völlig unklar, wie ich das Event identifizieren soll.<br />
Mit Fire_Event1 kann man ein Event feuern, aber welchen? und wie höre ich auf das Event?<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/849981</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/849981</guid><dc:creator><![CDATA[Clip]]></dc:creator><pubDate>Thu, 11 Aug 2005 09:37:40 GMT</pubDate></item><item><title><![CDATA[Reply to COM Events on Thu, 11 Aug 2005 11:46:41 GMT]]></title><description><![CDATA[<p>Hi, ich verwende für das ganze COM Zeugs das Tool COMMX von Greanleaf, war bei BCB5 als Freeware dabei.</p>
<p>mfg<br />
Tom</p>
]]></description><link>https://www.c-plusplus.net/forum/post/850063</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/850063</guid><dc:creator><![CDATA[Tom7]]></dc:creator><pubDate>Thu, 11 Aug 2005 11:46:41 GMT</pubDate></item><item><title><![CDATA[Reply to COM Events on Mon, 15 Aug 2005 09:04:29 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/9773">@Tom7</a>: Greanleaf, ist das nicht eine Lib zur Nutzung der seriellen COM Schnittstelle?</p>
<p>Ich habe jetzt im Builder folgende Klassen gefunden:<br />
Unit: CmAdmCtl</p>
<pre><code>TCOMAdminCatalog
TCOMAdminCatalogCollection
TCOMAdminCatalogObject
</code></pre>
<p>Leider kann ich damit nix anfangen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
<p>Die Methode TCOMAdminCatalog::GetCollection() findet keine registrierten Typenbibliotheken (Exception: &quot;Falscher Parameter&quot; ....</p>
<p>TCOMAdminCatalogCollection::PopulateByKey() benötigt als Parameter ein &quot;PSafeArray&quot;</p>
<p>Dieses muss (anscheindend ?) nach Instantierung mit &quot;SafeArrayCreate()&quot; beschrieben werden. Dazu gibt es in der MS Hilfe folgendes:<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/automat/htm/chap7_1rvp.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/automat/htm/chap7_1rvp.asp</a></p>
<blockquote>
<p>SafeArrayCreate</p>
<p>Creates a new array descriptor, allocates and initializes the data for the array, and returns a pointer to the new array descriptor.</p>
<p>SAFEARRAY* SafeArrayCreate(<br />
VARTYPE vt,<br />
unsigned int cDims,<br />
SAFEARRAYBOUND * rgsabound<br />
);</p>
<p>Parameters</p>
<p>vt<br />
The base type of the array (the VARTYPE of each element of the array). The VARTYPE is restricted to a subset of the variant types. Neither the VT_ARRAY nor the VT_BYREF flag can be set. VT_EMPTY and VT_NULL are not valid base types for the array. All other types are legal.<br />
cDims<br />
Number of dimensions in the array. The number cannot be changed after the array is created.<br />
rgsabound<br />
Pointer to a vector of bounds (one for each dimension) to allocate for the array.</p>
<p>Return Value</p>
<p>Points to the array descriptor, or Null if the array could not be created.<br />
Example</p>
<p>The following example demonstrates calling the SafeArrayCreate function.</p>
<pre><code class="language-cpp">SAFEARRAY * psa;
   SAFEARRAYBOUND rgsabound[1];

   rgsabound[0].lLbound = 0;
   rgsabound[0].cElements = 5;
   psa = SafeArrayCreate(VT_VARIANT, 1, rgsabound);
   if(psa == NULL)
      return E_OUTOFMEMORY;
   // Use the array 
   return NOERROR;
</code></pre>
<p>Requirements</p>
</blockquote>
<p>Diese Beschreibung verstehe ich leider nicht. Genauer, was Hilft mir das?<br />
Wo gebe ich z.B. an, dass ich alle Exents der registrierten Typenbibliothek &quot;AcroPDF&quot; haben möchte? Schießlich weißt mich der Parameter der Funktion TCOMAdminCatalogCollection::PopulateByKey(PSafeArray aKeys) doch darauf hin, dass ich die Events anhand eines Keys beziehen kann.</p>
<p>Ich weiß nicht weiter?<br />
hat denn niemand einen Tip?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/852372</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/852372</guid><dc:creator><![CDATA[Clip]]></dc:creator><pubDate>Mon, 15 Aug 2005 09:04:29 GMT</pubDate></item><item><title><![CDATA[Reply to COM Events on Tue, 16 Aug 2005 06:01:03 GMT]]></title><description><![CDATA[<p>@ Clip, stimmt ist vom Prinzip her sehr einfach und funkt super</p>
]]></description><link>https://www.c-plusplus.net/forum/post/852994</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/852994</guid><dc:creator><![CDATA[Tom7]]></dc:creator><pubDate>Tue, 16 Aug 2005 06:01:03 GMT</pubDate></item></channel></rss>