<?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[Probleme mit Konsole - dll]]></title><description><![CDATA[<p>Ich habe ein Problem mit meiner Konsolen Anwendung.<br />
Ich schreibe einen Chat der über Windows hooks funktioniert. Ich binde dazu eine .dll ein die auch den Hook erstellt (SetWindowsHookEx) Alle Parameter für einen korrekten globalen hokk sind gesetzt.<br />
(WH_KEYBOARD,HookProc,hinstance,0)<br />
Die variable hinstance ist eine Kopie des HINSTANCE Parameters der DllMain<br />
Funktion.<br />
Das Programm gibt den Fehler 1428(Kein ModulHandle spezifiziert) zurück.<br />
Was kann ich tun?</p>
<p>Ich kompiliere mit dev-CPP</p>
<p>P.S. habe schopn unter Namen masterfreek64 registriert</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/154366/probleme-mit-konsole-dll</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Jul 2026 17:38:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/154366.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 26 Jul 2006 15:39:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit Konsole - dll on Wed, 26 Jul 2006 15:39:18 GMT]]></title><description><![CDATA[<p>Ich habe ein Problem mit meiner Konsolen Anwendung.<br />
Ich schreibe einen Chat der über Windows hooks funktioniert. Ich binde dazu eine .dll ein die auch den Hook erstellt (SetWindowsHookEx) Alle Parameter für einen korrekten globalen hokk sind gesetzt.<br />
(WH_KEYBOARD,HookProc,hinstance,0)<br />
Die variable hinstance ist eine Kopie des HINSTANCE Parameters der DllMain<br />
Funktion.<br />
Das Programm gibt den Fehler 1428(Kein ModulHandle spezifiziert) zurück.<br />
Was kann ich tun?</p>
<p>Ich kompiliere mit dev-CPP</p>
<p>P.S. habe schopn unter Namen masterfreek64 registriert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1104719</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1104719</guid><dc:creator><![CDATA[masterfreek64-unreg]]></dc:creator><pubDate>Wed, 26 Jul 2006 15:39:18 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Konsole - dll on Wed, 26 Jul 2006 17:28:12 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=2822" rel="nofollow">SideWinder</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=13" rel="nofollow">DOS und Win32-Konsole</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1104805</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1104805</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Wed, 26 Jul 2006 17:28:12 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Konsole - dll on Wed, 26 Jul 2006 17:53:34 GMT]]></title><description><![CDATA[<p>zeig doch mal wo der fehler auftritt und wo du das angeblich (nicht) korrekte handle setzt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1104828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1104828</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 26 Jul 2006 17:53:34 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Konsole - dll on Thu, 27 Jul 2006 12:18:38 GMT]]></title><description><![CDATA[<p>Also der code ist hier</p>
<pre><code class="language-cpp">int __declspec(dllexport)__stdcall makeHook(HWND window) 
{
      hkb = NULL;

     hWndServer = window;

  hkb = SetWindowsHookEx( WH_KEYBOARD,
                           HookProc,
                           hinstance,
                           0);      
  if(hkb==NULL)
  {
  char err[10];
    int Error = GetLastError();

    sprintf(err, &quot;%d&quot;,  Error);
    MessageBox( NULL,
                &quot;Couldn't create Hook&quot;,
                &quot;Hook Error!&quot;,
                MB_OK);
                   MessageBox( NULL,
                err,
                &quot;Hook Error Code&quot;,
                MB_OK);

    return 0;
    }
    else 
    return 1;
}
</code></pre>
<p>Das Programm gibt dann die beiden MessageBoxes aus. Also Couldn't create hook und dann 1428</p>
<p>hinsatnce kommt aus</p>
<pre><code class="language-cpp">BOOL APIENTRY DllMain(HINSTANCE handle, DWORD dwReason, LPVOID lpReserved)
</code></pre>
<p>in DLLMAIN ist auch</p>
<pre><code class="language-cpp">if (dwReason == DLL_PROCESS_ATTACH)
 {

   // Init
   hinstance = handle;

  if(hinstance == NULL)
  {
               MessageBox(GetActiveWindow(), &quot;Handle for dll was not received&quot;, &quot;Error&quot;, MB_OK);
  }

 }
</code></pre>
<p>HookProc sieht so aus:</p>
<pre><code class="language-cpp">LRESULT __declspec(dllexport)__stdcall  CALLBACK HookProc(int nCode,WPARAM wParam, LPARAM lParam)
</code></pre>
<p>Der Code kompiliert in Dev-CPP problemlos in VC nicht (Ich nehm nie VC, ist zu strikt und die headers machen immer Probleme (Doppeldefinition ) oder ne Bibliothek wird nicht gefunden , etc...</p>
<p>So das müsste euch helfen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1105330</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1105330</guid><dc:creator><![CDATA[masterfreek64]]></dc:creator><pubDate>Thu, 27 Jul 2006 12:18:38 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Konsole - dll on Sun, 30 Jul 2006 13:03:35 GMT]]></title><description><![CDATA[<blockquote>
<p>hMod<br />
[in] Handle to the DLL containing the hook procedure pointed to by the lpfn parameter. The hMod parameter must be set to NULL if the dwThreadId parameter specifies a thread created by the current process and if the hook procedure is within the code associated with the current process.</p>
</blockquote>
<p>(C) <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/hooks/hookreference/hookfunctions/setwindowshookex.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/hooks/hookreference/hookfunctions/setwindowshookex.asp</a></p>
<p>Normalerweise du registrierst Funktion von der Hauptprogramme und spezifizierst hInstance von DLL. Wenn du von DLL hook registrierst, NULL fur hInstance ubergibt mussen.</p>
<p>Also hier ist ein gewisser unklar limitation:</p>
<blockquote>
<p>Warning There are serious limits on what you can do in a DLL entry point. To provide more complex initialization, create an initialization routine for the DLL. You can require applications to call the initialization routine before calling any other routines in the DLL. Alternatively, the initialization routine can create a file with an ACL that restricts access, and each routine in the DLL would call the initialization routine if the file does not exist.</p>
</blockquote>
<p>(C) <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/dllmain.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/dllmain.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107139</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107139</guid><dc:creator><![CDATA[RoboTact]]></dc:creator><pubDate>Sun, 30 Jul 2006 13:03:35 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Konsole - dll on Sun, 30 Jul 2006 13:11:21 GMT]]></title><description><![CDATA[<p>Ah danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1107145</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1107145</guid><dc:creator><![CDATA[masterfreek64]]></dc:creator><pubDate>Sun, 30 Jul 2006 13:11:21 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Konsole - dll on Tue, 01 Aug 2006 11:45:09 GMT]]></title><description><![CDATA[<p>Nein funktioniert nicht immer noch Error .</p>
<p>Habe versucht Code aus FAQ zu nehmen aber der hat mein Winsock kaputtgemacht(ja danach kam ein WinSock Fehler)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1108432</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1108432</guid><dc:creator><![CDATA[masterfreek64]]></dc:creator><pubDate>Tue, 01 Aug 2006 11:45:09 GMT</pubDate></item></channel></rss>