<?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[Kommunikation zwischen c++ DLL und VB]]></title><description><![CDATA[<p>Hallo Leute!</p>
<p>Ich hoffe dass ich mit meinem Thread in diesem Forum richtig bin, wenn<br />
nicht entschuldige ich mich hiermit!</p>
<p>Vorgabe:</p>
<p>(1) ein nicht in C geschriebenes Programm &quot;erstellt&quot; zur Laufzeit einen Verweis<br />
auf ein AtiveX-Object (hier: &quot;Server.Nachricht&quot;)</p>
<p>(2) eine in C++ geschriebene DLL</p>
<p>Ziel:</p>
<p>ist es, eine &quot;Brücke&quot; von der C DLL zu dem Programm aufzubauen um mit diesem zu<br />
kommunizieren (einfach einen String übergeben)</p>
<p>Mein Problem ist es eine Kommunikation von einer in C geschriebenen<br />
Dll zu einem VB Programm aufzubauen.</p>
<p>in VB läuft das so (kurz und knapp):</p>
<pre><code>Private Server As Object
Set Server = GetObject(, &quot;Server.Nachricht&quot;)

-&gt; Server.Message &quot;Hallo ich bin eine Nachricht oder so&quot; &lt;-
</code></pre>
<p>dieses &quot;Server.Message&quot; ist mein Problem</p>
<p>--------------------------------------------------------------</p>
<p>In der MSDN habe ich ein Beispiel gefunden und etwas<br />
abgeändert:</p>
<pre><code class="language-cpp">//main.c
     #include &lt;stdio.h&gt;
     #include &lt;windows.h&gt;
     #include &lt;oleauto.h&gt;
     #include &lt;unknwn.h&gt;
      void main(void) {
         IUnknown *pUnk;
         CLSID clsid;
         HRESULT hr;
         OleInitialize(NULL);
         {
         hr = CLSIDFromProgID(L&quot;Server.Nachricht&quot;, &amp;clsid);
         if(FAILED(hr)) {
           MessageBox(NULL, &quot;Server.Nachricht nicht gefunden&quot;, &quot;Error&quot;, MB_SETFOREGROUND);
           return;
           }
            hr = GetActiveObject(&amp;clsid, NULL, (IUnknown**)&amp;pUnk);
            if(FAILED(hr)) {
               MessageBox(NULL, &quot;Keine Verbindung zum Programm oder so&quot;, &quot;Error&quot;, MB_SETFOREGROUND);
               return;
	    }else{
               MessageBox(NULL, &quot;Verbindung zum Programm oder so&quot;, &quot;OK&quot;, MB_SETFOREGROUND);
               return;
	}
         }
         OleUninitialize();
      }
</code></pre>
<p>In diesem Beispiel wird nur, soweit ich das interpretieren<br />
kann, eine &quot;Verbindung&quot; erstellt (ich hoffe dieses<br />
Beispiel ist nicht mit allzuvielen Fehlern gespickt)<br />
aber dann hörts bei mir schon auf!</p>
<p>Kann ich das als Lösungsansatz bezeichnen?<br />
Könnt ihr mir bitte weiterhelfen?</p>
<p>Vielen Dank für Eure Hilfe</p>
<p>mfg bump</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/124047/kommunikation-zwischen-c-dll-und-vb</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 01:12:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/124047.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 22 Oct 2005 22:15:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Kommunikation zwischen c++ DLL und VB on Sat, 22 Oct 2005 22:15:16 GMT]]></title><description><![CDATA[<p>Hallo Leute!</p>
<p>Ich hoffe dass ich mit meinem Thread in diesem Forum richtig bin, wenn<br />
nicht entschuldige ich mich hiermit!</p>
<p>Vorgabe:</p>
<p>(1) ein nicht in C geschriebenes Programm &quot;erstellt&quot; zur Laufzeit einen Verweis<br />
auf ein AtiveX-Object (hier: &quot;Server.Nachricht&quot;)</p>
<p>(2) eine in C++ geschriebene DLL</p>
<p>Ziel:</p>
<p>ist es, eine &quot;Brücke&quot; von der C DLL zu dem Programm aufzubauen um mit diesem zu<br />
kommunizieren (einfach einen String übergeben)</p>
<p>Mein Problem ist es eine Kommunikation von einer in C geschriebenen<br />
Dll zu einem VB Programm aufzubauen.</p>
<p>in VB läuft das so (kurz und knapp):</p>
<pre><code>Private Server As Object
Set Server = GetObject(, &quot;Server.Nachricht&quot;)

-&gt; Server.Message &quot;Hallo ich bin eine Nachricht oder so&quot; &lt;-
</code></pre>
<p>dieses &quot;Server.Message&quot; ist mein Problem</p>
<p>--------------------------------------------------------------</p>
<p>In der MSDN habe ich ein Beispiel gefunden und etwas<br />
abgeändert:</p>
<pre><code class="language-cpp">//main.c
     #include &lt;stdio.h&gt;
     #include &lt;windows.h&gt;
     #include &lt;oleauto.h&gt;
     #include &lt;unknwn.h&gt;
      void main(void) {
         IUnknown *pUnk;
         CLSID clsid;
         HRESULT hr;
         OleInitialize(NULL);
         {
         hr = CLSIDFromProgID(L&quot;Server.Nachricht&quot;, &amp;clsid);
         if(FAILED(hr)) {
           MessageBox(NULL, &quot;Server.Nachricht nicht gefunden&quot;, &quot;Error&quot;, MB_SETFOREGROUND);
           return;
           }
            hr = GetActiveObject(&amp;clsid, NULL, (IUnknown**)&amp;pUnk);
            if(FAILED(hr)) {
               MessageBox(NULL, &quot;Keine Verbindung zum Programm oder so&quot;, &quot;Error&quot;, MB_SETFOREGROUND);
               return;
	    }else{
               MessageBox(NULL, &quot;Verbindung zum Programm oder so&quot;, &quot;OK&quot;, MB_SETFOREGROUND);
               return;
	}
         }
         OleUninitialize();
      }
</code></pre>
<p>In diesem Beispiel wird nur, soweit ich das interpretieren<br />
kann, eine &quot;Verbindung&quot; erstellt (ich hoffe dieses<br />
Beispiel ist nicht mit allzuvielen Fehlern gespickt)<br />
aber dann hörts bei mir schon auf!</p>
<p>Kann ich das als Lösungsansatz bezeichnen?<br />
Könnt ihr mir bitte weiterhelfen?</p>
<p>Vielen Dank für Eure Hilfe</p>
<p>mfg bump</p>
]]></description><link>https://www.c-plusplus.net/forum/post/899026</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/899026</guid><dc:creator><![CDATA[bump]]></dc:creator><pubDate>Sat, 22 Oct 2005 22:15:16 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation zwischen c++ DLL und VB on Sat, 22 Oct 2005 22:32:54 GMT]]></title><description><![CDATA[<p>Wenn alles Erfolgreich war, hast nen Interface über pUnk und da kannst ja über QueryInterface das richtige Interface holen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/899043</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/899043</guid><dc:creator><![CDATA[...]]></dc:creator><pubDate>Sat, 22 Oct 2005 22:32:54 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation zwischen c++ DLL und VB on Sun, 23 Oct 2005 08:47:12 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>... schrieb:</p>
<blockquote>
<p>Wenn alles Erfolgreich war, hast nen Interface über pUnk und da kannst ja über QueryInterface das richtige Interface holen.</p>
</blockquote>
<p>hört sich einfach an aber genau da liegt mein Problem!</p>
<p>Kurz gesagt ich habe keine Ahnung wie ich das Zustande bringen soll! <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>
<p>Könntet Ihr mir ein Beispiel geben?</p>
<p>mfg bump</p>
]]></description><link>https://www.c-plusplus.net/forum/post/899136</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/899136</guid><dc:creator><![CDATA[bump]]></dc:creator><pubDate>Sun, 23 Oct 2005 08:47:12 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation zwischen c++ DLL und VB on Sun, 23 Oct 2005 10:30:39 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/899179</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/899179</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sun, 23 Oct 2005 10:30:39 GMT</pubDate></item></channel></rss>