<?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[CreateObjekt aus VB, Gibt es so eine Methode auch in VC++]]></title><description><![CDATA[<p>Hi@all,</p>
<p>ich möchte mit einer Schnittstelle arbeiten.<br />
Gibt es für diese Geschichte in VC++ 6.0 auch eine Methode wie in VB CreateObject oder in Delphi CreateOleObject?</p>
<p>Gruß an alle,</p>
<p>CrazyPlaya</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/161216/createobjekt-aus-vb-gibt-es-so-eine-methode-auch-in-vc</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Jul 2026 02:07:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/161216.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 04 Oct 2006 13:32:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CreateObjekt aus VB, Gibt es so eine Methode auch in VC++ on Wed, 04 Oct 2006 13:32:10 GMT]]></title><description><![CDATA[<p>Hi@all,</p>
<p>ich möchte mit einer Schnittstelle arbeiten.<br />
Gibt es für diese Geschichte in VC++ 6.0 auch eine Methode wie in VB CreateObject oder in Delphi CreateOleObject?</p>
<p>Gruß an alle,</p>
<p>CrazyPlaya</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149263</guid><dc:creator><![CDATA[CrazyPlaya]]></dc:creator><pubDate>Wed, 04 Oct 2006 13:32:10 GMT</pubDate></item><item><title><![CDATA[Reply to CreateObjekt aus VB, Gibt es so eine Methode auch in VC++ on Wed, 04 Oct 2006 13:44:07 GMT]]></title><description><![CDATA[<p>Evtl. ist &quot;::CoCreateInstance&quot;, das was du suchst.</p>
<p><a href="http://windowssdk.msdn.microsoft.com/en-us/library/ms686615.aspx" rel="nofollow">http://windowssdk.msdn.microsoft.com/en-us/library/ms686615.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149272</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149272</guid><dc:creator><![CDATA[MP]]></dc:creator><pubDate>Wed, 04 Oct 2006 13:44:07 GMT</pubDate></item><item><title><![CDATA[Reply to CreateObjekt aus VB, Gibt es so eine Methode auch in VC++ on Wed, 04 Oct 2006 13:57:35 GMT]]></title><description><![CDATA[<p>Ich muss aber ein Object zurück bekommen mit dem ich die Funktion der Schnittstelle aufrufen kann.<br />
So wie ich das sehe bekomme ich sowas nicht durch CreateInstance.<br />
Ich bin leider noch ziemlicher Anfänger in Sachen COM und OLE habe die ganze Geschichte auch nocht nicht so ganz verstanden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149285</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149285</guid><dc:creator><![CDATA[CrazyPlaya]]></dc:creator><pubDate>Wed, 04 Oct 2006 13:57:35 GMT</pubDate></item><item><title><![CDATA[Reply to CreateObjekt aus VB, Gibt es so eine Methode auch in VC++ on Wed, 04 Oct 2006 14:00:11 GMT]]></title><description><![CDATA[<p>Wenn Du das VB pedant suchst, dann kannst Du die invhelp.cpp verwenden:<br />
<a href="http://blog.kalmbachnet.de/files/InvHelp.zip" rel="nofollow">http://blog.kalmbachnet.de/files/InvHelp.zip</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149287</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Wed, 04 Oct 2006 14:00:11 GMT</pubDate></item><item><title><![CDATA[Reply to CreateObjekt aus VB, Gibt es so eine Methode auch in VC++ on Wed, 04 Oct 2006 14:26:41 GMT]]></title><description><![CDATA[<p>Doch, du bekommst ein Objekt zurück ..</p>
<p>Ich poste mal einen Beispielcode anhand von Word:</p>
<pre><code class="language-cpp">HRESULT hr = E_FAIL;
CLSID clsid;
IUnknown *pUnk = NULL;
_Application WordApp;

hr = ::CLSIDFromString(OLESTR(&quot;Word.Application&quot;),&amp;clsid); // Statt Word.Application, das eingeben, was du bei CreateObject in VB eingeben würdest - sprich den Klassennamen.

// IID_IUnknown beschreibt das Interface das du haben möchtest.
hr = ::CoCreateInstance(clsid,NULL,CLSCTX_SERVER,IID_IUnknown,(void**)&amp;pUnk);

if(SUCCEEDED(hr))
{
   hr = pUnk-&gt;QueryInterface(IID_IDispatch,(void**)&amp;WordApp.m_lpDispatch);
}
</code></pre>
<p>WordApp könntest du jetzt weiterverwenden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1149303</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1149303</guid><dc:creator><![CDATA[MP]]></dc:creator><pubDate>Wed, 04 Oct 2006 14:26:41 GMT</pubDate></item></channel></rss>