<?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: entry point funktion wird nicht aufgerufen]]></title><description><![CDATA[<p>also, ich hab mir einen kleinen maushook nach vorbild des tastaturhooks in der faq zusammengebaut. das problem scheint im moment zu sein, dass der mingw den entry point nicht setzt(auch wenn ich mir sicher bin, dass die funktionsdeklaration richtig ist).</p>
<p>nach einem test mit einer messagebox, bin ich mir nun sicher, dass der mingw die funktion nicht aufruft(kann natürlich auch sein, dass messageboxen in entrpoints nicht gültig sind)</p>
<p>so sieht die funktion aus:</p>
<pre><code class="language-cpp">BOOL APIENTRY DllMain (HINSTANCE hInstance, DWORD reason,LPVOID){
	MessageBox (NULL,&quot;aufruf&quot;,&quot;aufruf&quot;, MB_ICONERROR);
	if(reason==DLL_PROCESS_ATTACH){
		instance=hInstance;
	}
	return true;
}
</code></pre>
<p>wie gesagt, hab mit dlls nicht so die erfahrung, aber meine suche in der msdn/im forum und bei google hat mich nicht weitergebracht, deshalb muss ich doch wegen dieser trivialen sache fragen <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/topic/93681/dll-entry-point-funktion-wird-nicht-aufgerufen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 25 Apr 2026 06:44:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/93681.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Dec 2004 15:46:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 15:47:34 GMT]]></title><description><![CDATA[<p>also, ich hab mir einen kleinen maushook nach vorbild des tastaturhooks in der faq zusammengebaut. das problem scheint im moment zu sein, dass der mingw den entry point nicht setzt(auch wenn ich mir sicher bin, dass die funktionsdeklaration richtig ist).</p>
<p>nach einem test mit einer messagebox, bin ich mir nun sicher, dass der mingw die funktion nicht aufruft(kann natürlich auch sein, dass messageboxen in entrpoints nicht gültig sind)</p>
<p>so sieht die funktion aus:</p>
<pre><code class="language-cpp">BOOL APIENTRY DllMain (HINSTANCE hInstance, DWORD reason,LPVOID){
	MessageBox (NULL,&quot;aufruf&quot;,&quot;aufruf&quot;, MB_ICONERROR);
	if(reason==DLL_PROCESS_ATTACH){
		instance=hInstance;
	}
	return true;
}
</code></pre>
<p>wie gesagt, hab mit dlls nicht so die erfahrung, aber meine suche in der msdn/im forum und bei google hat mich nicht weitergebracht, deshalb muss ich doch wegen dieser trivialen sache fragen <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/663704</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/663704</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Wed, 01 Dec 2004 15:47:34 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 16:04:35 GMT]]></title><description><![CDATA[<p>du hast vermutlich eine cpp dll erstellt dann musst du dllmain mit extern &quot;C&quot; umklammern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/663717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/663717</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 01 Dec 2004 16:04:35 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 16:07:41 GMT]]></title><description><![CDATA[<p>danke, das wars, jetzt funzt auch alles.</p>
<p>rofl. 1 stunde mindestens nach dem dummen fehler gesucht, und hier gibts das nach 18minuten <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/663721</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/663721</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Wed, 01 Dec 2004 16:07:41 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 19:41:22 GMT]]></title><description><![CDATA[<p>hmm neues problem,will dafür aber keinen neuen thread öffnen <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>
<p>ok, mein mousehook soll die MOUSEHOOKSTRUCT die es bei jedem mausklick doer bewegung bekommt an meine hauptapplication weiterleiten, das problem ist, das ding ist ein pointer, und wie ich schmerzlich in form eines systemfreezes erfahren musste, kann man nicht auf den speicher eines fremden prozesses zugreifen(irgendwie verständlich).</p>
<p>also hab ich mir folgenden kühnen plan überlegt:</p>
<pre><code class="language-cpp">HWND __attribute__((section (&quot;shared&quot;), shared)) window =0;
MOUSEHOOKSTRUCT __attribute__((section (&quot;shared&quot;), shared)) lastClick=MOUSEHOOKSTRUCT();//shared zwischen allen prozessen

//...
LRESULT CALLBACK MouseProc(int nCode,WPARAM wParam,LPARAM lParam){
	if(nCode==HC_ACTION){
		lastClick=*(MOUSEHOOKSTRUCT*)lParam;
		SendMessage(window,WM_USER+2,wParam,(LPARAM)&amp;lastClick);
	}
	return CallNextHookEx(0,nCode,wParam,lParam);
}
</code></pre>
<p>ich dachte mir, dass, wenn ich die struct in shared memory packe, ich problemlos von meinem prozess aus drauf zugreifen könnte, da soweit ich das verstehe, die dll über loadlibrary ja auch einmal in meinen prozess integriert wurde.</p>
<p>also hab ichs probiert, und o wunder, solange ich auf meinem fenster mit der maus rumhämmer klappt das auch, aber wehe, ich komme auf ein fenster eines fremden prozesses, DANN wirds übel(systemfreeze und so)</p>
<p>weis jemand wieso das so ist, doer wie ich das umgehen kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/663929</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/663929</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Wed, 01 Dec 2004 19:41:22 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 19:56:21 GMT]]></title><description><![CDATA[<p>bin mir nicht ganz sicher. aber ich denke das der handle des fensters von der anderen app überschrieben wird da diese ja dann auch zum prozess gehört.<br />
könnte aber auch totaler schwachfug sein <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /><br />
versuch dieses mal zu testen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/663952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/663952</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 01 Dec 2004 19:56:21 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 20:00:10 GMT]]></title><description><![CDATA[<p>nein, daran liegts nicht,den handle setz ich in einer anderen funktion, die nachrichten kommen auch alle in meinem prozess an, aber wenn ich dann im prozess mit dem lParam der nachricht folgendes mach:</p>
<pre><code class="language-cpp">HWND window=((MOUSEHOOKSTRUCT*)lParam)-&gt;hwnd;
</code></pre>
<p>dann ist ende(wenns nicht grad das fenster meines prozesses ist)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/663957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/663957</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Wed, 01 Dec 2004 20:00:10 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 20:35:28 GMT]]></title><description><![CDATA[<blockquote>
<p>There are restrictions to consider before using a shared data segment:</p>
<p>* Any variables in a shared data segment must be statically initialized. In the above example, i is initialized to 0 and a is 32 characters initialized to hello world.<br />
* All shared variables are placed in the compiled DLL in the specified data segment. Very large arrays can result in very large DLLs. This is true of all initialized global variables.<br />
* Never store process-specific information in a shared data segment. Most Win32 data structures or values (such as HANDLEs) are really valid only within the context of a single process.<br />
* Each process will get its own address space. It is very important that pointers are never stored in a variable contained in a shared data segment. A pointer may be perfectly valid in one application but not in another.<br />
* It is possible that the DLL itself could get loaded at a different address in the virtual address spaces of each process. It is not safe to have pointers to functions in the DLL or to other shared variables.</p>
<p>Note that these last three points apply to memory-mapped files and shared data segments.</p>
</blockquote>
<p>erfüllst du das alles, insbesondere punkt 3.</p>
<p>[edit] tollen msdn tag wieder geändert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664002</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664002</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 01 Dec 2004 20:35:28 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 20:43:10 GMT]]></title><description><![CDATA[<blockquote>
<p>* Any variables in a shared data segment must be statically initialized. In the above example, i is initialized to 0 and a is 32 characters initialized to hello world.<br />
<strong>Erfüll ich</strong><br />
* All shared variables are placed in the compiled DLL in the specified data segment. Very large arrays can result in very large DLLs. This is true of all initialized global variables.<br />
<strong>k, kein problem</strong><br />
* Never store process-specific information in a shared data segment. Most Win32 data structures or values (such as HANDLEs) are really valid only within the context of a single process.<br />
<strong>mein HWND ist solange konstant, wie mein fenster existiert, und wenn mein fenster gekillt wird, wird die dll entladen</strong><br />
* Each process will get its own address space. It is very important that pointers are never stored in a variable contained in a shared data segment. A pointer may be perfectly valid in one application but not in another.<br />
<strong>hier net wichtig</strong><br />
* It is possible that the DLL itself could get loaded at a different address in the virtual address spaces of each process. It is not safe to have pointers to functions in the DLL or to other shared variables.<br />
<strong>hmmm liegt hierdran das problem? ich weis nicht...</strong></p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/664009</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664009</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Wed, 01 Dec 2004 20:43:10 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 20:46:58 GMT]]></title><description><![CDATA[<p>zu drei, ich meine deine struct MOUSEHOOKSTRUCT</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664013</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 01 Dec 2004 20:46:58 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 20:50:38 GMT]]></title><description><![CDATA[<p>nein, daran liegts sicher nicht, weil mir mein debugger inzwischen durch zufall einen segmention fault geliefert hat, dh der zeiger den mein prozess auswertet zeigt auf einen bereich, auf den er nicht zeigen soll <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/664016</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664016</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Wed, 01 Dec 2004 20:50:38 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 21:18:17 GMT]]></title><description><![CDATA[<p>raten wir weiter. den es interessiert mich da ich selber noch nicht mit shared memory zu tun hatte und somit schon mal von vornherein ein paar fehler vermeiden<br />
kann. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>punkt1:<br />
initialier mal lastClick mit = { 0 }</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664042</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664042</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 01 Dec 2004 21:18:17 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Wed, 01 Dec 2004 22:19:40 GMT]]></title><description><![CDATA[<blockquote>
<p>raten wir weiter</p>
</blockquote>
<p>jo, is ja auch nur mein pc, den ich neustarten muss <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
<p>(nein brachte nichts)</p>
<p>//edit2: wenns net klappt, komm ich halt mit dem hammer und mach filemapping an, das funzt bestimmt, nur is es etwas klobig^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664071</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664071</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Wed, 01 Dec 2004 22:19:40 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Thu, 02 Dec 2004 11:42:06 GMT]]></title><description><![CDATA[<p>hab die lösung, ist mir auf dem weg zur schule eingefallen^^</p>
<p>und zwar geht es um die virtuellen addressräume, wenn in der geladenen dll a die sharedvariable an position 0x01F liegt, ist nicht garantiert, dass sie in einer dll b an derselben position liegt,dh bei meinem prozess greif ich auf die richtige position zu, und beim anderen..naja...schlecht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>mit anderen worten: auch wenn die variablen physikalisch am selben platz liegen, heisst das nicht, dass sie das im auch virtuellen addressraum sind.</p>
<p>und nun teste ich das mal <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>mit ner getter funktion klappt das <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/664346</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664346</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Thu, 02 Dec 2004 11:42:06 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Thu, 02 Dec 2004 15:27:50 GMT]]></title><description><![CDATA[<p>hab mich heute auch mal dran versucht <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> mit ner shared section bekomme ich es gar nicht hin (hab auch das eine oder andere mal neubooten müssen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> )<br />
speicher kopieren auch negativ.</p>
<p>mit ner einfachen get funktion hab ich hinbekommen. alle werte in die dll speichern. nachricht an app schicken diese ruft dann die get funktion auf.</p>
<p>mit mapped files funktioniert es super.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664596</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Thu, 02 Dec 2004 15:27:50 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Thu, 02 Dec 2004 16:47:36 GMT]]></title><description><![CDATA[<p>das es mit mapped files funzt war klar, ich wollte sie hier aber nich verwenden, da es doch ne ganze ecke code ist, und sich meiner meinung nach der aufwand für sone kleine sache nicht lohnt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664649</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664649</guid><dc:creator><![CDATA[otze]]></dc:creator><pubDate>Thu, 02 Dec 2004 16:47:36 GMT</pubDate></item><item><title><![CDATA[Reply to dll: entry point funktion wird nicht aufgerufen on Thu, 02 Dec 2004 16:56:01 GMT]]></title><description><![CDATA[<p>sind drei / vier aufrufe pro file. find ich net so viel.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/664654</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/664654</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Thu, 02 Dec 2004 16:56:01 GMT</pubDate></item></channel></rss>