<?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[Dynamisches einbinden einer DLL]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe folgendes Problem beim dynamischen Linken einer Libary:<br />
Die Funktion wird ausgeführ und danach kommt die Fehlermeldung:<br />
&quot;The value of ESP was not properly saved across a function call&quot;....<br />
Ich bin jetzt schon sechsmal alles durchgegangen, aber ich finde den Fehler nicht. Könnt ihr mir bitte helfen??</p>
<p>Header-Datei <a href="//common.h">//common.h</a>&quot;</p>
<pre><code>typedef unsigned long 	Dword;                                /* Dword as unsigned long				*/

typedef struct {
	int			iNumOfBurner;
	char		cDescription[10][64];
	char		cDriveLetter[10][2];
}R_DEVICE;
//Prototypen

void vGetDevices(R_DEVICE *ptDevice, Dword *dwAnswer);
</code></pre>
<p>Def.Datei</p>
<pre><code>LIBRARY   owndevice
HEAPSIZE 1024

EXPORTS
vBurnFiles	@1
vGetDevices	@2
</code></pre>
<p>Test-Programm</p>
<pre><code>#include &lt;windows.h&gt;
#include &quot;common.h&quot;			
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	FARPROC lpfnzDevices;
	HANDLE hLibHandle;
	R_DEVICE tDevice={0};
	Dword dwAnser;

	hLibHandle=LoadLibrary(&quot;OwnDevice.dll&quot;);
	if (hLibHandle &lt; (HANDLE)32)
	{
		return -1;
	}
	else
	{
		lpfnzDevices=GetProcAddress(hLibHandle, &quot;vGetDevices&quot;);
		(*lpfnzDevices)(&amp;tDevice, &amp;dwAnser);
		FreeLibrary(hLibHandle);
	}

	return 0;
}
</code></pre>
<p>Ich verwende VC++ 6.0 auf einer Windows XP Umgebung.<br />
Gruß Damion</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/69643/dynamisches-einbinden-einer-dll</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 01:11:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/69643.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 30 Mar 2004 08:42:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dynamisches einbinden einer DLL on Tue, 30 Mar 2004 08:42:35 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe folgendes Problem beim dynamischen Linken einer Libary:<br />
Die Funktion wird ausgeführ und danach kommt die Fehlermeldung:<br />
&quot;The value of ESP was not properly saved across a function call&quot;....<br />
Ich bin jetzt schon sechsmal alles durchgegangen, aber ich finde den Fehler nicht. Könnt ihr mir bitte helfen??</p>
<p>Header-Datei <a href="//common.h">//common.h</a>&quot;</p>
<pre><code>typedef unsigned long 	Dword;                                /* Dword as unsigned long				*/

typedef struct {
	int			iNumOfBurner;
	char		cDescription[10][64];
	char		cDriveLetter[10][2];
}R_DEVICE;
//Prototypen

void vGetDevices(R_DEVICE *ptDevice, Dword *dwAnswer);
</code></pre>
<p>Def.Datei</p>
<pre><code>LIBRARY   owndevice
HEAPSIZE 1024

EXPORTS
vBurnFiles	@1
vGetDevices	@2
</code></pre>
<p>Test-Programm</p>
<pre><code>#include &lt;windows.h&gt;
#include &quot;common.h&quot;			
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
	FARPROC lpfnzDevices;
	HANDLE hLibHandle;
	R_DEVICE tDevice={0};
	Dword dwAnser;

	hLibHandle=LoadLibrary(&quot;OwnDevice.dll&quot;);
	if (hLibHandle &lt; (HANDLE)32)
	{
		return -1;
	}
	else
	{
		lpfnzDevices=GetProcAddress(hLibHandle, &quot;vGetDevices&quot;);
		(*lpfnzDevices)(&amp;tDevice, &amp;dwAnser);
		FreeLibrary(hLibHandle);
	}

	return 0;
}
</code></pre>
<p>Ich verwende VC++ 6.0 auf einer Windows XP Umgebung.<br />
Gruß Damion</p>
]]></description><link>https://www.c-plusplus.net/forum/post/491447</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/491447</guid><dc:creator><![CDATA[Damion]]></dc:creator><pubDate>Tue, 30 Mar 2004 08:42:35 GMT</pubDate></item><item><title><![CDATA[Reply to Dynamisches einbinden einer DLL on Tue, 30 Mar 2004 09:00:33 GMT]]></title><description><![CDATA[<p>Das hat was mit der Calling Convention zu tun. Benutz mal __stdcall</p>
]]></description><link>https://www.c-plusplus.net/forum/post/491462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/491462</guid><dc:creator><![CDATA[__stdcall]]></dc:creator><pubDate>Tue, 30 Mar 2004 09:00:33 GMT</pubDate></item></channel></rss>