<?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[Late binding ?]]></title><description><![CDATA[<p>Hi</p>
<p>Ich krieg das mit dem late binding nicht hin .</p>
<p>Dazu habe ich die versucht die Dateien von Jochen Kalmbach<br />
einzubauen , damit ich etwas Licht im Tunnel finde.<br />
Jedoch kommt dabei immer der Fehler:</p>
<pre><code>d:\projekte\latebinding\INVHELP.CPP(473): fatal error C1010: 
Unerwartetes Dateiende während der Suche nach der Direktive für die 
vorkompilierte Headerdatei
</code></pre>
<p>kennt jemand den Fehler ?<br />
oder wei wie es geht ?</p>
<p>Danke und Gruß<br />
Linus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/142214/late-binding</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 00:22:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/142214.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Mar 2006 18:12:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 18:13:50 GMT]]></title><description><![CDATA[<p>Hi</p>
<p>Ich krieg das mit dem late binding nicht hin .</p>
<p>Dazu habe ich die versucht die Dateien von Jochen Kalmbach<br />
einzubauen , damit ich etwas Licht im Tunnel finde.<br />
Jedoch kommt dabei immer der Fehler:</p>
<pre><code>d:\projekte\latebinding\INVHELP.CPP(473): fatal error C1010: 
Unerwartetes Dateiende während der Suche nach der Direktive für die 
vorkompilierte Headerdatei
</code></pre>
<p>kennt jemand den Fehler ?<br />
oder wei wie es geht ?</p>
<p>Danke und Gruß<br />
Linus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1025783</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1025783</guid><dc:creator><![CDATA[linus]]></dc:creator><pubDate>Tue, 28 Mar 2006 18:13:50 GMT</pubDate></item><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 18:41:04 GMT]]></title><description><![CDATA[<p>Du musst in der CPP-Datei ganz oben ein</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
</code></pre>
<p>einfügen.<br />
Siehe: <a href="http://blog.kalmbachnet.de/?postid=63" rel="nofollow">http://blog.kalmbachnet.de/?postid=63</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1025814</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1025814</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 28 Mar 2006 18:41:04 GMT</pubDate></item><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 19:32:15 GMT]]></title><description><![CDATA[<p>Danke funktioniert:</p>
<p>Wenn ich jetzt Deinen Code verwende</p>
<pre><code class="language-cpp">LPDISPATCH pdispWord; 
	CreateObject(OLESTR(&quot;Word.Basic&quot;), &amp;pdispWord); 
	Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL, 
		OLESTR(&quot;AppShow&quot;), NULL);    
	Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL, 
		OLESTR(&quot;FileNewDefault&quot;), NULL);  
	Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL,  
		OLESTR(&quot;Insert&quot;), TEXT(&quot;s&quot;), (LPOLESTR)OLESTR(&quot;This is a test&quot;));
	Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL,  
		OLESTR(&quot;FileSaveAs&quot;), TEXT(&quot;s&quot;), OLESTR(&quot;c:\sample.doc&quot;)); 
	pdispWord-&gt;Release(); }
</code></pre>
<p>kommt dei Fehlermeldung :<br />
CreateObject keine 2 Argumente<br />
außerdem habe ich gesehen daß :</p>
<pre><code class="language-cpp">extern HRESULT CreateObject(LPOLESTR pszProgID, IDispatch FAR* FAR* ppdisp);
</code></pre>
<p><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="😕"
    /> Ich versuchs erstmal zu verstehen <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/1025859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1025859</guid><dc:creator><![CDATA[linus]]></dc:creator><pubDate>Tue, 28 Mar 2006 19:32:15 GMT</pubDate></item><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 19:42:44 GMT]]></title><description><![CDATA[<p>Hmmm... bei mir geht das folgende ohne Probleme:</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &lt;windows.h&gt;
#include &quot;invhelp.h&quot;

int _tmain(int argc, _TCHAR* argv[])
{
  CoInitialize(NULL);

  LPDISPATCH pdispWord; 
  CreateObject(OLESTR(&quot;Word.Basic&quot;), &amp;pdispWord); 
  Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL, 
    OLESTR(&quot;AppShow&quot;), NULL);     
  Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL, 
    OLESTR(&quot;FileNewDefault&quot;), NULL);   
  Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL,   
    OLESTR(&quot;Insert&quot;), TEXT(&quot;s&quot;), (LPOLESTR)OLESTR(&quot;This is a test&quot;)); 
  Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL,   
    OLESTR(&quot;FileSaveAs&quot;), TEXT(&quot;s&quot;), OLESTR(&quot;c:\\sample.doc&quot;)); 
  pdispWord-&gt;Release();

  CoUninitialize();
  return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1025865</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1025865</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 28 Mar 2006 19:42:44 GMT</pubDate></item><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 19:54:41 GMT]]></title><description><![CDATA[<p>Ich habs in MFC-Dialog einem Button zugeordnet</p>
<p>Hier den ganzen Code:</p>
<pre><code class="language-cpp">#include &quot;stdafx.h&quot;
#include &lt;Windows.h&gt;
#include &quot;latebinding.h&quot;
#include &quot;latebindingDlg.h&quot;
#include &quot;INVHELP.H&quot;
#include &quot;.\latebindingdlg.h&quot;
...

void ClatebindingDlg::OnBnClickedButton1()
{
	CoInitialize(NULL); 

	LPDISPATCH pdispWord; 
	CreateObject(OLESTR(&quot;Word.Basic&quot;), &amp;pdispWord); 
	Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL, 
		OLESTR(&quot;AppShow&quot;), NULL);     
	Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL, 
		OLESTR(&quot;FileNewDefault&quot;), NULL);   
	Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL,   
		OLESTR(&quot;Insert&quot;), TEXT(&quot;s&quot;), (LPOLESTR)OLESTR(&quot;This is a test&quot;)); 
	Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL,   
		OLESTR(&quot;FileSaveAs&quot;), TEXT(&quot;s&quot;), OLESTR(&quot;c:\\sample.doc&quot;)); 
	pdispWord-&gt;Release(); 

	CoUninitialize(); 
}
</code></pre>
<pre><code>d:\projekte\latebinding\latebindingDlg.cpp(159): 
error C2660: 'CWnd::CreateObject': Funktion akzeptiert keine 2 Argumente
</code></pre>
<p>allerdings kenne ich die Anweisung</p>
<pre><code class="language-cpp">CoInitialize(NULL);
</code></pre>
<p>nicht</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1025887</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1025887</guid><dc:creator><![CDATA[linus]]></dc:creator><pubDate>Tue, 28 Mar 2006 19:54:41 GMT</pubDate></item><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 20:02:20 GMT]]></title><description><![CDATA[<p>achso :</p>
<p>COM initialisieren mit CoInitialize</p>
<p>muß ich auch noch lernen <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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1025892</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1025892</guid><dc:creator><![CDATA[linus]]></dc:creator><pubDate>Tue, 28 Mar 2006 20:02:20 GMT</pubDate></item><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 20:05:10 GMT]]></title><description><![CDATA[<p>Eigentlich solltest Du das CoInitialize gaaaaaaanz am Anfang machen (bzw. macht das nicht schon die MFC !? )</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1025897</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1025897</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 28 Mar 2006 20:05:10 GMT</pubDate></item><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 20:11:24 GMT]]></title><description><![CDATA[<p>ok, ich lass es erst mal weg<br />
und hoffe dass MFC das schon erledigt<br />
jedoch bleibt da die Fehlermeldung <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1025903</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1025903</guid><dc:creator><![CDATA[linus]]></dc:creator><pubDate>Tue, 28 Mar 2006 20:11:24 GMT</pubDate></item><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 21:24:38 GMT]]></title><description><![CDATA[<p>Du solltest anstelle von</p>
<pre><code class="language-cpp">CreateObject
</code></pre>
<p>folgendes verwenden:</p>
<pre><code class="language-cpp">::CreateObject
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1025955</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1025955</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Tue, 28 Mar 2006 21:24:38 GMT</pubDate></item><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 21:34:29 GMT]]></title><description><![CDATA[<p>Hey , Klasse So funktioniert es</p>
<p>Vielen Dank für deine Hilfe</p>
<p>Gruß Linus<br />
<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="🙂"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1025964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1025964</guid><dc:creator><![CDATA[linus]]></dc:creator><pubDate>Tue, 28 Mar 2006 21:34:29 GMT</pubDate></item><item><title><![CDATA[Reply to Late binding ? on Tue, 28 Mar 2006 22:41:43 GMT]]></title><description><![CDATA[<p>Sorry wenn ich noch einmal darauf zurückkomme</p>
<p>aber bei Excel scheint es doch etwas schwieriger zu sein :</p>
<p>Ich hab da folgendes gefunden für VB:</p>
<pre><code>'   Dieses Beispiel zeigt, wie man die Object Library benutzt 
'   (early binding). Möchte man &quot;late binding&quot; verwenden, stehen die 
'   Werte und Datentypen dabei.

'   Ein paar Variablen
Dim xclApp As Excel.Application     '   As Object
Dim boolAppLoad As Boolean
Dim xclWbk As Excel.Workbook        '   As Object
Dim boolWbkLoad As Boolean
Dim xclSht As Excel.Worksheet       '   As Object
Dim strFile As String

'   Fehlerbehandlungsverhalten setzen
On Error Resume Next

'   Alte Fehler löschen
Err.Clear

'   Datei benennen
strFile = &quot;C:\My Files\zeit.xls&quot;

'   Excel referenzieren
Set xclApp = GetObject(, &quot;Excel.Application&quot;)

'   Ist ein Fehler aufgetreten (Excel war dann nicht geladen)?
If (Err.Number &lt;&gt; 0) Then
    '   Fehler löschen
    Err.Clear

    '   Excel war nicht geladen
    boolAppLoad = True

    '   Excel jetzt starten
    Set xclApp = CreateObject(&quot;Excel.Application&quot;)
Else
    '   Excel war geladen
    boolAppLoad = False
End If

'   Workbook referenzieren
Set xclWbk = xclApp.Workbooks.Item(strFile)

'   Ist ein Fehler aufgetreten (Workbook war dann nicht geöffnet)?
If (Err.Number &lt;&gt; 0) Then
    '   Fehler löschen
    Err.Clear

    '   Workbook war nicht geöffnet
    boolWbkLoad = True

    '   Workbook öffnen
    Set xclWbk = xclApp.Workbooks.Open(strFile, _
                                , , , , , , , , , , , False)
Else
    '   Workbook war geöffnet
    boolWbkLoad = False
End If

'   Erste Tabelle referenzieren
Set xclSht = xclWbk.Worksheets(1)

'   Hier jetzt die Verarbeitung
[...]

'   Referenz entfernen
Set xclSht = Nothing

'   Mußte das Workbook geladen werden?
If (boolWbkLoad) Then
    '   Ja, Workbook speichern schließen
    xclWbk.Close xlSaveChanges  '   xlSaveChanges = 1
End If

'   Referenz entfernen
Set xclWbk = Nothing

'   Mußte Excel geladen werden?
If (boolAppLoad) Then
    '   Ja, Excel beenden
    xclApp.Quit
End If

'   Referenz entfernen
Set xclApp = Nothing
</code></pre>
<p>Wenn ich das richtig verstanden habe muss ich jetzt entsprechend die<br />
Befehle und Werte mittels invoke senden .<br />
Nur habe ich jetzt drei Objekte :</p>
<p>Application<br />
Workbook<br />
Worksheet</p>
<p>Ich krieg das irgendwie nicht zusammen.</p>
<pre><code class="language-cpp">::CreateObject(OLESTR(&quot;Excel.Application&quot;), &amp;pdispWord); 
	Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL, 
		OLESTR(&quot;Workbooks.Add&quot;), NULL);     
	Invoke(pdispWord, DISPATCH_METHOD, NULL, NULL, NULL, 
		OLESTR(&quot;Worksheets(1)&quot;), NULL);
</code></pre>
<p>Vielleicht hast Du ja noch einen kleinen Tip<br />
<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="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1026008</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1026008</guid><dc:creator><![CDATA[linus]]></dc:creator><pubDate>Tue, 28 Mar 2006 22:41:43 GMT</pubDate></item></channel></rss>