<?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[ERROR_CANNOT_FIND_WND_CLASS]]></title><description><![CDATA[<p>ähnliches Problem wie der Thread vor meinem,</p>
<p>Ich weiß leider nicht &quot;warum&quot; beim Fensterkreiren Windows die Klasse nicht findet, die ich kurz zuvor registriert habe. Hier der Source</p>
<pre><code class="language-cpp">WNDCLASS wc;
    wc.style          = CS_HREDRAW | CS_VREDRAW;
    wc.cbClsExtra     = 0;
    wc.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground  = (HBRUSH)(COLOR_BTNFACE+1);
    wc.lpszMenuName   = NULL;

    wc.cbWndExtra          =2*sizeof(int);
    wc.hIcon               = NULL;
    wc.lpfnWndProc         = StWnd;
    wc.lpszClassName       = &quot;StateWindow&quot;;

    string strr=&quot;&quot;;
    ATOM class_=RegisterClass(&amp;wc);
    if(class_!=0){strr=&quot; class registred &quot;;
    strr+=int_to_str(GetLastError());
    }
    else{ strr=&quot;there was an unidentified error&quot;;};

    char*strrr=new char[strr.size()+1];
  strcpy(strrr,strr.c_str());

  int iAntwort = MessageBox(NULL, strrr, &quot;Construct StateWindow&quot;,
                                   MB_ICONINFORMATION | MB_OKCANCEL | MB_DEFBUTTON1);
  delete[] strrr;
   this-&gt;dwExStyle=WS_EX_CLIENTEDGE;
   this-&gt;lpClassName=&quot;StateWindow&quot;;
   this-&gt;lpWindowName=&quot;lalala&quot;; 

   this-&gt;dwStyle=WS_CHILD | WS_VISIBLE;
   this-&gt;data.x=xPos;
   this-&gt;data.y=yPos;
   this-&gt;data.nWidth=xSize;
   this-&gt;data.nHeight=ySize;
   this-&gt;hWndParent=hwnd;
   this-&gt;hMenu=NULL;
   this-&gt;hInstance=instance;
   this-&gt;lpParam=NULL;

      this-&gt;handle = CreateWindowEx(this-&gt;dwExStyle,this-&gt;lpClassName,this-&gt;lpWindowName,this-&gt;dwStyle,this-&gt;data.x,this-&gt;data.y,this-&gt;data.nWidth,this-&gt;data.nHeight,
                           this-&gt;hWndParent,this-&gt;hMenu,this-&gt;hInstance,this-&gt;lpParam);

 strr=&quot;&quot;;
   if(this-&gt;handle != NULL){strr=&quot;WindowCreated&quot;;}
   else{strr=&quot;Oh Oh, there has been an error: &quot;;
   strr+=int_to_str(GetLastError());
   }
   char*st_rrr=new char[strr.size()+1];
   strcpy(st_rrr,strr.c_str());

iAntwort = MessageBox(NULL, st_rrr, &quot;CreateStateWindow&quot;,
                                   MB_ICONINFORMATION | MB_OKCANCEL | MB_DEFBUTTON1);

   delete[] st_rrr;
</code></pre>
<p>Die erste Message gibt mir ein Ok mit ner 2 raus, anscheinend classAtom<br />
Die zweite sagt aber &quot;ohoh :1407&quot; also Klasse nicht gefunden, komischer weise hatte das letztens alles noch sooooo schön funktioniert,</p>
<p>Selbst das Class Atom ins Lowword von lpsClassname schieben hilft net,..</p>
<p>weiß jemand woran das liegen könnte?? Ich bin gerade echt am Verzweifeln</p>
<p>grüße und dank</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/228370/error_cannot_find_wnd_class</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 19:22:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/228370.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Nov 2008 13:24:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ERROR_CANNOT_FIND_WND_CLASS on Thu, 27 Nov 2008 13:24:18 GMT]]></title><description><![CDATA[<p>ähnliches Problem wie der Thread vor meinem,</p>
<p>Ich weiß leider nicht &quot;warum&quot; beim Fensterkreiren Windows die Klasse nicht findet, die ich kurz zuvor registriert habe. Hier der Source</p>
<pre><code class="language-cpp">WNDCLASS wc;
    wc.style          = CS_HREDRAW | CS_VREDRAW;
    wc.cbClsExtra     = 0;
    wc.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground  = (HBRUSH)(COLOR_BTNFACE+1);
    wc.lpszMenuName   = NULL;

    wc.cbWndExtra          =2*sizeof(int);
    wc.hIcon               = NULL;
    wc.lpfnWndProc         = StWnd;
    wc.lpszClassName       = &quot;StateWindow&quot;;

    string strr=&quot;&quot;;
    ATOM class_=RegisterClass(&amp;wc);
    if(class_!=0){strr=&quot; class registred &quot;;
    strr+=int_to_str(GetLastError());
    }
    else{ strr=&quot;there was an unidentified error&quot;;};

    char*strrr=new char[strr.size()+1];
  strcpy(strrr,strr.c_str());

  int iAntwort = MessageBox(NULL, strrr, &quot;Construct StateWindow&quot;,
                                   MB_ICONINFORMATION | MB_OKCANCEL | MB_DEFBUTTON1);
  delete[] strrr;
   this-&gt;dwExStyle=WS_EX_CLIENTEDGE;
   this-&gt;lpClassName=&quot;StateWindow&quot;;
   this-&gt;lpWindowName=&quot;lalala&quot;; 

   this-&gt;dwStyle=WS_CHILD | WS_VISIBLE;
   this-&gt;data.x=xPos;
   this-&gt;data.y=yPos;
   this-&gt;data.nWidth=xSize;
   this-&gt;data.nHeight=ySize;
   this-&gt;hWndParent=hwnd;
   this-&gt;hMenu=NULL;
   this-&gt;hInstance=instance;
   this-&gt;lpParam=NULL;

      this-&gt;handle = CreateWindowEx(this-&gt;dwExStyle,this-&gt;lpClassName,this-&gt;lpWindowName,this-&gt;dwStyle,this-&gt;data.x,this-&gt;data.y,this-&gt;data.nWidth,this-&gt;data.nHeight,
                           this-&gt;hWndParent,this-&gt;hMenu,this-&gt;hInstance,this-&gt;lpParam);

 strr=&quot;&quot;;
   if(this-&gt;handle != NULL){strr=&quot;WindowCreated&quot;;}
   else{strr=&quot;Oh Oh, there has been an error: &quot;;
   strr+=int_to_str(GetLastError());
   }
   char*st_rrr=new char[strr.size()+1];
   strcpy(st_rrr,strr.c_str());

iAntwort = MessageBox(NULL, st_rrr, &quot;CreateStateWindow&quot;,
                                   MB_ICONINFORMATION | MB_OKCANCEL | MB_DEFBUTTON1);

   delete[] st_rrr;
</code></pre>
<p>Die erste Message gibt mir ein Ok mit ner 2 raus, anscheinend classAtom<br />
Die zweite sagt aber &quot;ohoh :1407&quot; also Klasse nicht gefunden, komischer weise hatte das letztens alles noch sooooo schön funktioniert,</p>
<p>Selbst das Class Atom ins Lowword von lpsClassname schieben hilft net,..</p>
<p>weiß jemand woran das liegen könnte?? Ich bin gerade echt am Verzweifeln</p>
<p>grüße und dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1621779</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1621779</guid><dc:creator><![CDATA[zeusosc]]></dc:creator><pubDate>Thu, 27 Nov 2008 13:24:18 GMT</pubDate></item><item><title><![CDATA[Reply to ERROR_CANNOT_FIND_WND_CLASS on Thu, 27 Nov 2008 13:56:11 GMT]]></title><description><![CDATA[<p>Was Du hier machst ist extrem gefährlich. Du solltest Strukturen immer vollständig initialisiert.<br />
WNDCLASS::hInstance wurde nicht gesetzt.</p>
<p>CreateWindow kann also die Fensterklasse nicht finden. Der Fehler ist folgerichtig selbst gemacht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1621813</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1621813</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 27 Nov 2008 13:56:11 GMT</pubDate></item><item><title><![CDATA[Reply to ERROR_CANNOT_FIND_WND_CLASS on Thu, 27 Nov 2008 14:37:23 GMT]]></title><description><![CDATA[<p>Als ich bei WNDCLASS die instance mit übergeben hatte,<br />
bekam ich den Fehler 87: ERROR_INVALID_PARAMETER</p>
<p>Anscheinend ,also bei mir in dem fall,<br />
hatte der Klassenname ärger gemacht,<br />
das habe ich jetzt mit</p>
<pre><code class="language-cpp">char*Classenname=new char[11];
strcpy(Classenname,&quot;StateWindow&quot;);
</code></pre>
<p>kompensieren können.</p>
<p>Die WNDCLASS habe ich durch eine WNDCLASSEX (wegen cbSize) struktur ersetzt<br />
und die Instance wieder mitübergeben.</p>
<p>Jetzt scheint es zu funktionieren und kann die CreateWindow wieder in eine andere (Klassen-)Methode auslagern.</p>
<p>Mann mann mann, das hat mich jetzt aber nerven gekostet.</p>
<p>Ich danke Dir <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/1621859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1621859</guid><dc:creator><![CDATA[zeusosc]]></dc:creator><pubDate>Thu, 27 Nov 2008 14:37:23 GMT</pubDate></item><item><title><![CDATA[Reply to ERROR_CANNOT_FIND_WND_CLASS on Thu, 27 Nov 2008 14:45:22 GMT]]></title><description><![CDATA[<p>zeusosc schrieb:</p>
<blockquote>
<p>Als ich bei WNDCLASS die instance mit übergeben hatte,<br />
bekam ich den Fehler 87: ERROR_INVALID_PARAMETER</p>
<p>Anscheinend ,also bei mir in dem fall,<br />
hatte der Klassenname ärger gemacht,<br />
das habe ich jetzt mit</p>
</blockquote>
<p>Kann ich mir nicht vorstellen... Dan hast Du Unsinn übergeben. Zudem benötigst Du keinen mit new allokierten Zeiger um einen Klassenamen anzugeben.<br />
Das zuweisen der Konstante würde genügen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1621868</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1621868</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 27 Nov 2008 14:45:22 GMT</pubDate></item></channel></rss>