<?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[[DLL] Kleiner Quellcodefehler?]]></title><description><![CDATA[<p>Ich bekomme leider immer &quot;InitDLL Fehler&quot; angezeigt.<br />
Ich weiss nur nicht wo der Fehler sein soll.<br />
Ich habe von einem Freund damals eine DLL bekommen für Dateianalyse.<br />
Ich wollte es mir jetzt mal einbinden und bekomme es nicht hin und er ist im Urlaub <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
<p>Er hat mir ne kleine Beschreibung begefügt..</p>
<pre><code class="language-cpp">function InitDLL : Bollean; far; external 'DateiAnalyse.dll' index 1;
</code></pre>
<p>In seinem Delphi Beispielcode fügt er die DLL so ein.</p>
<pre><code class="language-cpp">implementation
 function InitDLL : Boolean; external 'DateiAnalyse.dll';
</code></pre>
<p>Was mach ich falsch?</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#include &quot;windows.h&quot;

#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
typedef bool TInitDLL(void);

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
	if (!DllInstance) DllInstance = LoadLibrary(&quot;DateiAnalyse.dll&quot;);
	if (DllInstance)
	{
		Caption = &quot;DLL wurde geladen.&quot;;
		InitDLL = (TInitDLL*)GetProcAddress(DllInstance, &quot;_InitDLL&quot;);
		if (InitDLL != NULL) b_init = InitDLL();
		else Caption = &quot;InitDLL Fehler&quot;;
	}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
	FreeLibrary(DllInstance);
}
//---------------------------------------------------------------------------
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/92792/dll-kleiner-quellcodefehler</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Jul 2026 15:04:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/92792.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 23 Nov 2004 10:32:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [DLL] Kleiner Quellcodefehler? on Tue, 23 Nov 2004 10:32:45 GMT]]></title><description><![CDATA[<p>Ich bekomme leider immer &quot;InitDLL Fehler&quot; angezeigt.<br />
Ich weiss nur nicht wo der Fehler sein soll.<br />
Ich habe von einem Freund damals eine DLL bekommen für Dateianalyse.<br />
Ich wollte es mir jetzt mal einbinden und bekomme es nicht hin und er ist im Urlaub <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
<p>Er hat mir ne kleine Beschreibung begefügt..</p>
<pre><code class="language-cpp">function InitDLL : Bollean; far; external 'DateiAnalyse.dll' index 1;
</code></pre>
<p>In seinem Delphi Beispielcode fügt er die DLL so ein.</p>
<pre><code class="language-cpp">implementation
 function InitDLL : Boolean; external 'DateiAnalyse.dll';
</code></pre>
<p>Was mach ich falsch?</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#include &quot;windows.h&quot;

#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
typedef bool TInitDLL(void);

//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
	if (!DllInstance) DllInstance = LoadLibrary(&quot;DateiAnalyse.dll&quot;);
	if (DllInstance)
	{
		Caption = &quot;DLL wurde geladen.&quot;;
		InitDLL = (TInitDLL*)GetProcAddress(DllInstance, &quot;_InitDLL&quot;);
		if (InitDLL != NULL) b_init = InitDLL();
		else Caption = &quot;InitDLL Fehler&quot;;
	}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormDestroy(TObject *Sender)
{
	FreeLibrary(DllInstance);
}
//---------------------------------------------------------------------------
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/657185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/657185</guid><dc:creator><![CDATA[Maik0101]]></dc:creator><pubDate>Tue, 23 Nov 2004 10:32:45 GMT</pubDate></item><item><title><![CDATA[Reply to [DLL] Kleiner Quellcodefehler? on Tue, 23 Nov 2004 13:36:09 GMT]]></title><description><![CDATA[<p>ich habe überhaupt kein verständnis für solche poster wie du!!</p>
<p>welche fehler bringt er denn</p>
<p>[edit]<br />
nur &quot;InitDLL Fehler&quot; wohl kaum</p>
]]></description><link>https://www.c-plusplus.net/forum/post/657188</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/657188</guid><dc:creator><![CDATA[Blackhawk]]></dc:creator><pubDate>Tue, 23 Nov 2004 13:36:09 GMT</pubDate></item><item><title><![CDATA[Reply to [DLL] Kleiner Quellcodefehler? on Tue, 23 Nov 2004 13:44:33 GMT]]></title><description><![CDATA[<p>Blackhawk schrieb:</p>
<blockquote>
<p>ich habe überhaupt kein verständnis für solche poster wie du!!</p>
</blockquote>
<p>Müsste es nicht heißen... äh... egal. Wollte nur fragen, was du meinst. Den Dreifachpost? Eben war das Forum etwas... down. Da passiert sowas.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/657199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/657199</guid><dc:creator><![CDATA[HEZ]]></dc:creator><pubDate>Tue, 23 Nov 2004 13:44:33 GMT</pubDate></item><item><title><![CDATA[Reply to [DLL] Kleiner Quellcodefehler? on Tue, 23 Nov 2004 13:54:48 GMT]]></title><description><![CDATA[<p>Also ein Dreifachpost war nun garnicht beabsichtigt.<br />
Da schiebe ich die Schuld auf das Forum.<br />
Irgendwie scheint das übel hinüber zu sein <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>Dem Quellcode zu folge</p>
<pre><code class="language-cpp">if (InitDLL != NULL) b_init = InitDLL();
        else Caption = &quot;InitDLL Fehler&quot;;
</code></pre>
<p>heisst das, das die diese Zeile fehlgeschlagen sein muss</p>
<pre><code class="language-cpp">InitDLL = (TInitDLL*)GetProcAddress(DllInstance, &quot;_InitDLL&quot;);
</code></pre>
<p>ich habe es mal mit</p>
<pre><code class="language-cpp">InitDLL = (TInitDLL*)GetProcAddress(DllInstance, &quot;InitDLL&quot;);
</code></pre>
<p>(Ohne Unterstrich) probiert und es &quot;scheint&quot; zu gehen. Frage mich aber wieso dann in jedem dummen Beispiel im Netz nen Untertrich vorhanden ist und in der DLL Funktion nicht <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/657214</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/657214</guid><dc:creator><![CDATA[Maik0101]]></dc:creator><pubDate>Tue, 23 Nov 2004 13:54:48 GMT</pubDate></item><item><title><![CDATA[Reply to [DLL] Kleiner Quellcodefehler? on Tue, 23 Nov 2004 13:58:08 GMT]]></title><description><![CDATA[<p>Ich bitte den Moderator die anderen identischen Beiträge zu entfernen. Das Forum war leider tot und ich habe nicht geahnt das es obwohl es Minutenlang &quot;festhing&quot; es trotzdem gesendet hatte. Kam ins Forum auch nicht rein, um nachzusehen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f611.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--expressionless_face"
      title="-_-"
      alt="😑"
    /></p>
<p>Tut mir wirklich Leid. Für technisches Versagen kann ich nun aber auch nichts.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/657217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/657217</guid><dc:creator><![CDATA[Maik0101]]></dc:creator><pubDate>Tue, 23 Nov 2004 13:58:08 GMT</pubDate></item><item><title><![CDATA[Reply to [DLL] Kleiner Quellcodefehler? on Tue, 23 Nov 2004 13:59:52 GMT]]></title><description><![CDATA[<p>oh mann entschuldigung vielmals!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/657221</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/657221</guid><dc:creator><![CDATA[Blackhawk]]></dc:creator><pubDate>Tue, 23 Nov 2004 13:59:52 GMT</pubDate></item></channel></rss>