<?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[GetProcAddress findet funktionen nicht]]></title><description><![CDATA[<p>Hallo community,<br />
ich hoffe ihr könnt mir bei meinem Problem helfen.<br />
Ich habe mit eben eine dll erstellt und versuche nun die Funtkionen in einem anderen Projekt zu verwenden.</p>
<p>Hier der teil aus der dll</p>
<pre><code class="language-cpp">extern &quot;C&quot;
{	__declspec(dllexport) XLstatus /*__stdcall*/ Init(XLaccess *pxlChannelMaskTx, unsigned char *pxlChannelIndex);}
</code></pre>
<p>Wenn ich mir die .dll dann mit dem Dependency Walker anschau wird die dll auch richtig erstellt und die Funktionsnamen sind dank extern C auch nicht verändert.</p>
<p>So nun will ich die Funktionen in meinem Hauptprogramm nutzen dazu mach ich folgendes:</p>
<pre><code class="language-cpp">typedef XLstatus (*BinaryFunction_t) (XLaccess, unsigned char);

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

	HINSTANCE hinstLib;
	hinstLib = LoadLibrary(L&quot;test.dll&quot;);

	BinaryFunction_t Init;
	createfkt CreateRxThread;
         BOOL fFreeResult;

	if (hinstLib == NULL)
	{
		cout &lt;&lt; &quot;load Failed&quot;&lt;&lt; endl;
	}
	XLaccess		xlChanMaskTx = 0;
	unsigned char	xlChanIndex = 0;
	XLstatus		xlStatus = XL_ERROR;

         Init = (BinaryFunction_t) GetProcAddress (hinstLib, &quot;Init&quot;) ;

     // call funktion from Dll
     if ( Init != NULL )
           xlStatus = Init(xlChanMaskTx, xlChanIndex);
</code></pre>
<p>Hier leifert mir getProcaddress immer null!<br />
Das laden der dll funktioniert noch!<br />
Nur warum findet er die Funktion nicht ?? der Name stimmt, wie ich ja dank Dependency Walker.</p>
<p>Danke für eure Hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/275686/getprocaddress-findet-funktionen-nicht</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 19:02:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/275686.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 19 Oct 2010 12:08:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GetProcAddress findet funktionen nicht on Tue, 19 Oct 2010 12:08:24 GMT]]></title><description><![CDATA[<p>Hallo community,<br />
ich hoffe ihr könnt mir bei meinem Problem helfen.<br />
Ich habe mit eben eine dll erstellt und versuche nun die Funtkionen in einem anderen Projekt zu verwenden.</p>
<p>Hier der teil aus der dll</p>
<pre><code class="language-cpp">extern &quot;C&quot;
{	__declspec(dllexport) XLstatus /*__stdcall*/ Init(XLaccess *pxlChannelMaskTx, unsigned char *pxlChannelIndex);}
</code></pre>
<p>Wenn ich mir die .dll dann mit dem Dependency Walker anschau wird die dll auch richtig erstellt und die Funktionsnamen sind dank extern C auch nicht verändert.</p>
<p>So nun will ich die Funktionen in meinem Hauptprogramm nutzen dazu mach ich folgendes:</p>
<pre><code class="language-cpp">typedef XLstatus (*BinaryFunction_t) (XLaccess, unsigned char);

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

	HINSTANCE hinstLib;
	hinstLib = LoadLibrary(L&quot;test.dll&quot;);

	BinaryFunction_t Init;
	createfkt CreateRxThread;
         BOOL fFreeResult;

	if (hinstLib == NULL)
	{
		cout &lt;&lt; &quot;load Failed&quot;&lt;&lt; endl;
	}
	XLaccess		xlChanMaskTx = 0;
	unsigned char	xlChanIndex = 0;
	XLstatus		xlStatus = XL_ERROR;

         Init = (BinaryFunction_t) GetProcAddress (hinstLib, &quot;Init&quot;) ;

     // call funktion from Dll
     if ( Init != NULL )
           xlStatus = Init(xlChanMaskTx, xlChanIndex);
</code></pre>
<p>Hier leifert mir getProcaddress immer null!<br />
Das laden der dll funktioniert noch!<br />
Nur warum findet er die Funktion nicht ?? der Name stimmt, wie ich ja dank Dependency Walker.</p>
<p>Danke für eure Hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1967493</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1967493</guid><dc:creator><![CDATA[extern]]></dc:creator><pubDate>Tue, 19 Oct 2010 12:08:24 GMT</pubDate></item><item><title><![CDATA[Reply to GetProcAddress findet funktionen nicht on Tue, 19 Oct 2010 12:35:59 GMT]]></title><description><![CDATA[<p>1. Falsches Forum, korrekt wäre WinAPI<br />
2. Kann es sein, dass Du die DLL von der falschen Stelle lädtst? Z.B. eine ältere Version? Nicht neu kompiliert, etc.</p>
<p><strong>Edit:</strong><br />
Ausserdem stimmt der typedef für den Funktionspointer nicht mit der Signatur der Funktion überein:</p>
<pre><code class="language-cpp">typedef XLstatus (*BinaryFunction_t) (XLaccess, unsigned char);
</code></pre>
<p>Sollte wohl eher so sein:</p>
<pre><code class="language-cpp">typedef XLstatus (*BinaryFunction_t) (XLaccess*, unsigned char*);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1967505</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1967505</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Tue, 19 Oct 2010 12:35:59 GMT</pubDate></item><item><title><![CDATA[Reply to GetProcAddress findet funktionen nicht on Tue, 19 Oct 2010 12:47:58 GMT]]></title><description><![CDATA[<p>ach verdammt. Ja jetzt gehts.<br />
Da hatte ich wohl mal was rumkopiert.</p>
<p>danke für die Hilfe</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1967512</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1967512</guid><dc:creator><![CDATA[extern]]></dc:creator><pubDate>Tue, 19 Oct 2010 12:47:58 GMT</pubDate></item></channel></rss>