<?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[DLLs Funktionen mit Parametern...]]></title><description><![CDATA[<p>Hallo !<br />
Ich habe ein Problem...<br />
Ich kann zwar Funktionen aus eigenen DLLs aufrufen, allerdings bekomme ich folgende Fehlermeldung wenn ich versuche das ganze System mit Parametern/rückgabewerten laufen zulassen...<br />
**Module:<br />
i386\chkesp.c<br />
Line:42<br />
The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.<br />
**<br />
Wenn ich das ganze Project schritt für schritt durchlaufen lasse bekomme ich diesen fehler <em>nachdem</em> die Funktion in der DLL ausgeführt wurde und der Wert der DLLfunktion schon zurückgegeben wurde ( die variable im programm selbst allerdings wird damit nie gefüllt weil ja vorher der fehler kommt...)</p>
<p>die relevanten Abschnitte meines Programms sehen folgendermaßen aus</p>
<pre><code class="language-cpp">#include &quot;dllversion.h&quot;
CTSPlugins::p_CheckIfUsefull()
{
	bool no_errors=true;
	CString location =  p_GetCurrentPlugin()-&gt;p_GetFileLocation();
	HINSTANCE hLib;

	GETNAME lpfGetName = NULL;
	INITPLUGIN lpfInitPlugin = NULL;

	CString p_Name;
	int i=0;
// getprocaddresses ist von http://www.codeproject.com
	if(GetProcAddresses( &amp;hLib,location, 2,
        &amp;lpfInitPlugin, &quot;InitPlugIn&quot;,
		&amp;lpfGetName, &quot;GetName&quot;))
    {
        lpfInitPlugin();
		i=lpfGetName(NULL,&quot;test&quot;,&quot;&quot;,0);

    }else
		no_errors = false;
//sonstige geschichten

//typendefinition (dllversion.h)
typedef int ( WINAPI *GETNAME ) 
    ( HWND , LPCSTR, LPCSTR, DWORD);

//dll
#define PLUG_API __declspec (dllexport)
extern &quot;C&quot; PLUG_API int GetName(HWND , LPCSTR, LPCSTR, DWORD);
PLUG_API int GetName(HWND hwnd, LPCSTR text, LPCSTR title, DWORD type)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	int i=0;
	i = MessageBox(hwnd,text,title,type);
	return i;
}
</code></pre>
<p>ich fänds klasse wenn mir mal jemand sagen könnte was ich nap mal wieder falsch mache .... <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/topic/63232/dlls-funktionen-mit-parametern</link><generator>RSS for Node</generator><lastBuildDate>Thu, 04 Jun 2026 09:34:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/63232.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 30 Jan 2004 16:37:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DLLs Funktionen mit Parametern... on Fri, 30 Jan 2004 16:37:06 GMT]]></title><description><![CDATA[<p>Hallo !<br />
Ich habe ein Problem...<br />
Ich kann zwar Funktionen aus eigenen DLLs aufrufen, allerdings bekomme ich folgende Fehlermeldung wenn ich versuche das ganze System mit Parametern/rückgabewerten laufen zulassen...<br />
**Module:<br />
i386\chkesp.c<br />
Line:42<br />
The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.<br />
**<br />
Wenn ich das ganze Project schritt für schritt durchlaufen lasse bekomme ich diesen fehler <em>nachdem</em> die Funktion in der DLL ausgeführt wurde und der Wert der DLLfunktion schon zurückgegeben wurde ( die variable im programm selbst allerdings wird damit nie gefüllt weil ja vorher der fehler kommt...)</p>
<p>die relevanten Abschnitte meines Programms sehen folgendermaßen aus</p>
<pre><code class="language-cpp">#include &quot;dllversion.h&quot;
CTSPlugins::p_CheckIfUsefull()
{
	bool no_errors=true;
	CString location =  p_GetCurrentPlugin()-&gt;p_GetFileLocation();
	HINSTANCE hLib;

	GETNAME lpfGetName = NULL;
	INITPLUGIN lpfInitPlugin = NULL;

	CString p_Name;
	int i=0;
// getprocaddresses ist von http://www.codeproject.com
	if(GetProcAddresses( &amp;hLib,location, 2,
        &amp;lpfInitPlugin, &quot;InitPlugIn&quot;,
		&amp;lpfGetName, &quot;GetName&quot;))
    {
        lpfInitPlugin();
		i=lpfGetName(NULL,&quot;test&quot;,&quot;&quot;,0);

    }else
		no_errors = false;
//sonstige geschichten

//typendefinition (dllversion.h)
typedef int ( WINAPI *GETNAME ) 
    ( HWND , LPCSTR, LPCSTR, DWORD);

//dll
#define PLUG_API __declspec (dllexport)
extern &quot;C&quot; PLUG_API int GetName(HWND , LPCSTR, LPCSTR, DWORD);
PLUG_API int GetName(HWND hwnd, LPCSTR text, LPCSTR title, DWORD type)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	int i=0;
	i = MessageBox(hwnd,text,title,type);
	return i;
}
</code></pre>
<p>ich fänds klasse wenn mir mal jemand sagen könnte was ich nap mal wieder falsch mache .... <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/447894</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/447894</guid><dc:creator><![CDATA[Trigger_Hurt]]></dc:creator><pubDate>Fri, 30 Jan 2004 16:37:06 GMT</pubDate></item></channel></rss>