<?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[Aufrufenden Prozess einer DLL]]></title><description><![CDATA[<p>Hi,</p>
<p>meine DLL soll beim Aufruf einer DLL-Fkt. abhängig vom Aufrufer reagieren. Wie lässt die aufrufende Anwendung bzw. der aufrufenden Prozess herausfinden?</p>
<p>Danke,<br />
don_basto.</p>
<p>PS: Die Suche hat nicht geholfen ..</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/144624/aufrufenden-prozess-einer-dll</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 18:43:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/144624.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 19 Apr 2006 19:41:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Wed, 19 Apr 2006 19:41:27 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>meine DLL soll beim Aufruf einer DLL-Fkt. abhängig vom Aufrufer reagieren. Wie lässt die aufrufende Anwendung bzw. der aufrufenden Prozess herausfinden?</p>
<p>Danke,<br />
don_basto.</p>
<p>PS: Die Suche hat nicht geholfen ..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1040886</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1040886</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Wed, 19 Apr 2006 19:41:27 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Wed, 19 Apr 2006 20:01:59 GMT]]></title><description><![CDATA[<p>Na weiss ned so genau was du meinst und was du machen willst aber schau dir mal an : GetModuleHandle(0), GetCurrentProcess, GetCurrentProcessId.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1040904</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1040904</guid><dc:creator><![CDATA[fadasda]]></dc:creator><pubDate>Wed, 19 Apr 2006 20:01:59 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Wed, 19 Apr 2006 20:02:50 GMT]]></title><description><![CDATA[<p>Dies geht mit unmanaged Code nur sehr schwer, da Du hier den Callstack anschauen musst und dann entscheiden woher der Aufruf kam...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1040907</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1040907</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Wed, 19 Apr 2006 20:02:50 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Wed, 19 Apr 2006 20:15:43 GMT]]></title><description><![CDATA[<p>Danke, werd erstmal mit den Fkt. experimentieren und meld mich nochmal.</p>
<p>Diese Dll-Fkt. soll nur in einem bestimmten Kontext aktiv sein. Wenn der Aufruf von einem Client kommt, soll was passieren, aus dem Editor-Programm heraus aber nicht, da es dort nur stört. Da das Editorprogramm einen festen Name hat, muss ich nur herausfinden, ob es der Aufrufer ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1040915</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1040915</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Wed, 19 Apr 2006 20:15:43 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Wed, 19 Apr 2006 20:30:30 GMT]]></title><description><![CDATA[<p>Jochen Kalmbach schrieb:</p>
<blockquote>
<p>Dies geht mit unmanaged Code nur sehr schwer, da Du hier den Callstack anschauen musst und dann entscheiden woher der Aufruf kam...</p>
</blockquote>
<p>Nur aus interesse: Wo genau siehst du ein Problem? Mit GetModuleHandle(NULL) kommt an die exe instance welche die dll gelanden und kann z.b. über GetModuleFileName checken ob es client oder editor ist. Der einzige spezielfall der mir hier einfällt ist COM und (soweit ich das überlicke <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="🤡"
    /> ) dann aber auch nur bei exe servern oder RPCs</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1040924</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1040924</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Wed, 19 Apr 2006 20:30:30 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Wed, 19 Apr 2006 20:55:37 GMT]]></title><description><![CDATA[<p>CMatt schrieb:</p>
<blockquote>
<p>Wo genau siehst du ein Problem? Mit GetModuleHandle(NULL) kommt an die exe instance welche die dll gelanden</p>
</blockquote>
<p>Ja, da geb ich Dir natürlich recht... ich habe die Frage überinterpretiert <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="😞"
    /><br />
Wenn es nur darum geht, in welchem Prozess die DLL läuft (was ja der Topic sagt), dann geht es selbstverständlich mit &quot;GetModuleFileName(NULL, ....)&quot;. GetModuleHandle wird nicht viel bringen, da hier für jeden Prozess das gleiche zurückkommt...</p>
<p>In dem Nachrichtentext steht aber irgendwas von &quot;Aufrufer der Funktion&quot; und dass muss ja nicht zwangsweise aus der EXE sein, sondern könnte auch aus einer anderen DLL erfolgen. Und das rauszufinden ist wieder etwas komplexer...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1040938</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1040938</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Wed, 19 Apr 2006 20:55:37 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Wed, 19 Apr 2006 21:03:04 GMT]]></title><description><![CDATA[<p>GetModuleHandle() scheint aber zu funktionieren:</p>
<pre><code class="language-cpp">char	buf[256];
	char	tmp[512];

	HMODULE hModule = ::GetModuleHandle(NULL);
	if (hModule)
	{
		::GetModuleFileName(hModule, buf, 255);
		sprintf(tmp, &quot;Modul(\&quot;NULL\&quot;) = %s&quot;, buf); 
		::MessageBox(NULL, tmp, &quot;Test&quot;, MB_OK);
	}

	sprintf(buf, &quot;Editor.exe\0&quot;);
	hModule = ::GetModuleHandle(buf);
	if (hModule)
	{
		::GetModuleFileName(hModule, buf, 255);
		sprintf(tmp, &quot;Modul(\&quot;Editor.exe\&quot;) = %s&quot;, buf);
		::MessageBox(NULL, tmp, &quot;Test&quot;, MB_OK);
	}
</code></pre>
<p>Die Box kommt im Editor zweimal (&quot;NULL&quot; und &quot;Editor.exe&quot;), beim Client nur für &quot;NULL&quot;.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1040941</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1040941</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Wed, 19 Apr 2006 21:03:04 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Wed, 19 Apr 2006 22:50:08 GMT]]></title><description><![CDATA[<blockquote>
<p>dann geht es selbstverständlich mit &quot;GetModuleFileName(NULL, ....)&quot;. GetModuleHandle wird nicht viel bringen, da hier für jeden Prozess das gleiche zurückkommt...</p>
</blockquote>
<p>dachte ich auch bis mich die MSDN ins grübeln gebracht hat</p>
<p>GetModuleHandle</p>
<blockquote>
<p>If this parameter is NULL, GetModuleHandle returns a handle to the file used to create the calling process.</p>
</blockquote>
<p>GetModuleFileName</p>
<blockquote>
<p>If this parameter is NULL, GetModuleFileName retrieves the path for the current module.</p>
</blockquote>
<p>current module ist die dll oder? Müsste man mal testen was raus kommt <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1040983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1040983</guid><dc:creator><![CDATA[CMatt]]></dc:creator><pubDate>Wed, 19 Apr 2006 22:50:08 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Thu, 20 Apr 2006 05:59:39 GMT]]></title><description><![CDATA[<p>CMatt schrieb:</p>
<blockquote>
<blockquote>
<p>If this parameter is NULL, GetModuleFileName retrieves the path for the current module.</p>
</blockquote>
</blockquote>
<p>Welche Doku hast denn Du??? Die scheint aber schon einige Tage auf dem Buckel zu haben <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 />
In der aktuellen Doku steht:</p>
<blockquote>
<p>If this parameter is NULL, GetModuleFileName retrieves the path of the executable file of the current process.</p>
</blockquote>
<p><a href="http://msdn.microsoft.com/library/en-us/dllproc/base/getmodulefilename.asp" rel="nofollow">http://msdn.microsoft.com/library/en-us/dllproc/base/getmodulefilename.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1041034</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1041034</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Thu, 20 Apr 2006 05:59:39 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Thu, 20 Apr 2006 08:24:14 GMT]]></title><description><![CDATA[<p>Worauf wollt ihr hinaus?</p>
<p>Jochen Kalmbach schrieb:</p>
<blockquote>
<p>GetModuleHandle wird nicht viel bringen, da hier für jeden Prozess das gleiche zurückkommt...</p>
</blockquote>
<p>Mein Quelltext zeigt, dass ich mit GetModuleHandle() und dem Editornamen als Parameter genau das erreiche, was ich will. Mit GetModuleFileName() müsste ich mit Hilfe des zurückgegebenen Pfads den Namen Exe raussuchen, was ich mir mit GetModuleHandle spare. <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/1041083</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1041083</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Thu, 20 Apr 2006 08:24:14 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Thu, 20 Apr 2006 09:09:43 GMT]]></title><description><![CDATA[<p>Sag ich ja... &quot;GetModuleHandle&quot; hilft dir (alleine) nicht weiter...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1041125</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1041125</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Thu, 20 Apr 2006 09:09:43 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Thu, 20 Apr 2006 09:34:00 GMT]]></title><description><![CDATA[<p>Also ich bin immer noch nicht schlauer. <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/1041140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1041140</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Thu, 20 Apr 2006 09:34:00 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Thu, 20 Apr 2006 10:03:44 GMT]]></title><description><![CDATA[<p>don_basto schrieb:</p>
<blockquote>
<p>Also ich bin immer noch nicht schlauer. <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>
</blockquote>
<p>Ich dachte Dein Problem ist gelöst <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/1041168</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1041168</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Thu, 20 Apr 2006 10:03:44 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Thu, 20 Apr 2006 10:13:29 GMT]]></title><description><![CDATA[<p>Ja, aber mit den Beiträgen von Dir und CMatt konnte ich nichts anfangen. Vllt. habe ich ja was übersehen. Ist nur reine Neugier.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1041176</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1041176</guid><dc:creator><![CDATA[don_basto]]></dc:creator><pubDate>Thu, 20 Apr 2006 10:13:29 GMT</pubDate></item><item><title><![CDATA[Reply to Aufrufenden Prozess einer DLL on Thu, 20 Apr 2006 10:15:41 GMT]]></title><description><![CDATA[<p>Nein, Du hast nichts übersehen... &quot;GetModuleHandle(NULL)&quot; liefert immer das gleiche zurück, egal in welchem Prozess es läuft (nämlich 0x040000 o.s.ä.). Wenn Du aber dann noch &quot;GetModuleFileName&quot; aufrufst, so liefert er Dir den Namen der EXE zurück (was Du ja willst).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1041181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1041181</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Thu, 20 Apr 2006 10:15:41 GMT</pubDate></item></channel></rss>