<?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[Darstellung eines Windows Forms mit bestimmer Größe (some Errors)]]></title><description><![CDATA[<p><strong>Edit:</strong> Problem aus diesem Post veraltet. Neues Problem siehe unten.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/211295/darstellung-eines-windows-forms-mit-bestimmer-größe-some-errors</link><generator>RSS for Node</generator><lastBuildDate>Tue, 13 Oct 2026 21:53:39 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/211295.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Apr 2008 13:21:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Darstellung eines Windows Forms mit bestimmer Größe (some Errors) on Mon, 21 Apr 2008 17:12:11 GMT]]></title><description><![CDATA[<p><strong>Edit:</strong> Problem aus diesem Post veraltet. Neues Problem siehe unten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1495654</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1495654</guid><dc:creator><![CDATA[Andraste]]></dc:creator><pubDate>Mon, 21 Apr 2008 17:12:11 GMT</pubDate></item><item><title><![CDATA[Reply to Darstellung eines Windows Forms mit bestimmer Größe (some Errors) on Mon, 21 Apr 2008 14:07:58 GMT]]></title><description><![CDATA[<p>du solltest mal gucken, ob du alle Klammern die du geöffnet hast, auch wieder geschlossen hast <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/1495685</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1495685</guid><dc:creator><![CDATA[Firefighter]]></dc:creator><pubDate>Mon, 21 Apr 2008 14:07:58 GMT</pubDate></item><item><title><![CDATA[Reply to Darstellung eines Windows Forms mit bestimmer Größe (some Errors) on Mon, 21 Apr 2008 14:10:33 GMT]]></title><description><![CDATA[<p>Andraste schrieb:</p>
<blockquote>
<p>Aber wenn ich das mache, bekomme ich sogar 16 Fehler ausgegeben. Woran liegts?</p>
</blockquote>
<p>Am Code.</p>
<p>Die Anzahl der Fehler sagt übrigens nicht viel aus.</p>
<p>Zeigst du jetzt den relevanten Teil des Codes? Oder muss sich jeder, der dir helfen will, das Buch kaufen und rumprobieren, welches Beispiel du gerade bearbeitest?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1495687</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1495687</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 21 Apr 2008 14:10:33 GMT</pubDate></item><item><title><![CDATA[Reply to Darstellung eines Windows Forms mit bestimmer Größe (some Errors) on Mon, 21 Apr 2008 14:14:49 GMT]]></title><description><![CDATA[<p>Hatte schon erwartet, dass die Frage nach dem Code kommt. Klar könnt ihr haben.<br />
Ich war mir nicht sicher ober der Callback mit in die int APIENTRY WinMain rein, oder außerhalb stehen muss.<br />
Bekomme mitlerweile viele Fehler wie &quot;undeklarierter Bezeichner&quot; wie in Z20 weiß aber einfach nich wie ichs richtig machen kann.<br />
Naja ... bin dankbar für jeden Hinweis, den ihr findet. Wieder mal Dank im Voraus <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>
<pre><code>#include &quot;StdAfx.h&quot;

const int ultris_nettobreite = 360;
const int ultris_nettohoehe  = 520;
int ultris_bruttobreite;
int ultris_bruttohoehe;
HINSTANCE ultris_instance;
HWND ultris_window;
HMENU ultris_menu;

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                     LPSTR lpCmdLine, int nCmdShow)
{
	MSG msg;
	HACCEL acc;
	WNDCLASSEX wcx;
	wcx.cbSize = sizeof( wcx);
	wcx.lpszClassName = TEXT( &quot;Ultris&quot;);
	wcx.lpfnWndProc = ultris_windowhandler;
	wcx.style = CS_VREDRAW | CS_HREDRAW;
	wcx.hInstance = hInst;
	wcx.hIcon = LoadIcon (hInst,MAKEINTRESOURCE(IDI_MAIN));
	wcx.hIconSm = LoadIcon(hInst,MAKEINTRESOURCE(IDI_MAIN));
	wcx.hCursor = LoadCursor(NULL,IDC_ARROW);
	wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
	wcx.lpszMenuName = MAKEINTRESOURCE(IDR_MENU);
	wcx.cbClsExtra = 0;
	wcx.cbWndExtra = 0;

	if(!RegisterClassEx(&amp;wcx))
		return 0;
	acc = LoadAccelerators(hInst,MAKEINTRESOURCE(IDR_ACCEL));
	ultris_bruttohoehe = ultris_nettohoehe
					+ 2*GetSystemMetrics(SM_CYSIZEFRAME)
					+ GetSystemMetrics(SM_CYMENU)
					+ GetSystemMetrics(SM_CYCAPTION);
	ultris_bruttobreite = ultris_nettobreite
					+ 2*GetSystemMetrics(SM_CXSIZEFRAME);
	ultris_window = CreateWindowEx(0,TEXT(&quot;Ultris&quot;),TEXT(&quot;Ultris&quot;),
						WS_OVERLAPPEDWINDOW &amp; ~WS_MAXIMIZEBOX,
						CW_USERDEFAULT,CW_USERDEFAULT,
						ultris_bruttobreite,ultris_bruttohoehe,
								NULL,NULL,hInst,NULL);
	if(!ultris_window)
		return 0;
	MoveWindow(ultris_window,
			(GetSystemMetrics(SM_CXSCREEN)-ultris_bruttobreite)/2,
			(GetSystemMetrics(SM_CYSCREEN)-ultris_bruttohoehe)/2,
				ultris_bruttobreite, ultris_bruttohoehe, TRUE);
	ShowWindow(ultris_window,nCmdShow);
	ultris_instance = hInst;
	ultris_menu = GetMenu(ultris_window);
	while(TRUE)
	{
		if(PeekMessage(&amp;msg,NULL,0,0,PM_NOREMOVE))
		{
			if(GetMessage(&amp;msg,NULL,0,0) == 0)
				return 0; // Message ist WM_QUIT
			if(TranslateAccelerator(ultris_window,acc,&amp;msg) == 0)
			{
				TranslateMessage(&amp;msg);
				DispatchMessage(&amp;msg);
			}
		}
		else
		{
			// Hier können wir uns nun um das Spiel kümmern
		}
	}

LRESULT CALLBACK ultris_windowhandler(HWND hWnd, UINT msg,
								WPARAM wParam, LPARAM lParam)
	{
		switch(msg)
		{
		case WM_COMMAND:
			switch(LOWORD(wParam))
			{
			case IDM_EXIT:
				PostMessage(hWnd, WM_CLOSE, 0, 0);
				return 0;
			}
			break;
			case WM_GETMINMAXINFO:
				((MINMAXINFO *)lParam)-&gt;ptMinTrackSize.x = ((MINMAXINFO) *)lParam)-&gt;ptMaxTrackSize.x = ultris_bruttobreite;
				((MINMAXINFO *)lParam)-&gt;ptMinTrackSize.y = ((MINMAXINFO) *)lParam)-&gt;ptMaxTrackSize.y = ultris_bruttohoehe;
				return 0;
			case WM_DESTROY:
				PostQuitMessage(0);
				return 0;
		}
	return DefWindowProc (hWnd, msg, wParam, lParam);
	}
} // Ende der WinMain
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1495690</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1495690</guid><dc:creator><![CDATA[Andraste]]></dc:creator><pubDate>Mon, 21 Apr 2008 14:14:49 GMT</pubDate></item><item><title><![CDATA[Reply to Darstellung eines Windows Forms mit bestimmer Größe (some Errors) on Mon, 21 Apr 2008 14:14:20 GMT]]></title><description><![CDATA[<p>Bei der Fehlermeldung im Zusammenhang mit vorkompilierten Headern kann es auch helfen, einmal &quot;Erstellen -&gt; Bereinigen -&gt; Alles neu Erstellen&quot; zu betätigen. Manchmal bleibt in de Header-Kompilaten irgendwelcher Scheiss hängen und der Compiler merkt nicht, dass was geändert wurde. Oder die orkompilierten Header gleich ganz abschalten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1495691</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1495691</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Mon, 21 Apr 2008 14:14:20 GMT</pubDate></item><item><title><![CDATA[Reply to Darstellung eines Windows Forms mit bestimmer Größe (some Errors) on Mon, 21 Apr 2008 14:15:59 GMT]]></title><description><![CDATA[<p>Ja, hab ich schon gemacht <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="🙂"
    /> Aber wie sich mittlerweile herausgestellt hat, scheinen die Fehler an anderen Stellen zu liegen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1495692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1495692</guid><dc:creator><![CDATA[Andraste]]></dc:creator><pubDate>Mon, 21 Apr 2008 14:15:59 GMT</pubDate></item><item><title><![CDATA[Reply to Darstellung eines Windows Forms mit bestimmer Größe (some Errors) on Mon, 21 Apr 2008 15:31:01 GMT]]></title><description><![CDATA[<p>Nimm die Windowproc komplett raus aus der WinMain. Wer hat dir denn sowas erzählt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1495732</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1495732</guid><dc:creator><![CDATA[mad_martin]]></dc:creator><pubDate>Mon, 21 Apr 2008 15:31:01 GMT</pubDate></item><item><title><![CDATA[Reply to Darstellung eines Windows Forms mit bestimmer Größe (some Errors) on Mon, 21 Apr 2008 17:37:57 GMT]]></title><description><![CDATA[<p>wie gesagt ... der code (so wie er da steht) kommt aus nem tut <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="=/"
      alt="😕"
    /><br />
aber ok hab ihn rausgenommen</p>
<p>jez bekomm ich noch folgende 8 fehler. könnte mir da auch wer bei helfen?</p>
<pre><code>c:\...\ultris.cpp(22) : error C2065: 'hInst' : nichtdeklarierter Bezeichner
c:\...\ultris.cpp(22) : error C2440: '=' : 'int' kann nicht in 'struct HINSTANCE__ *' konvertiert werden
        Die Konvertierung eines ganzzahligen Typs in einen Zeigertyp erfordert ein reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat
c:\...\ultris.cpp(23) : error C2065: 'IDI_MAIN' : nichtdeklarierter Bezeichner
c:\...\ultris.cpp(27) : error C2065: 'IDR_MENU' : nichtdeklarierter Bezeichner
c:\...\ultris.cpp(33) : error C2065: 'IDR_ACCEL' : nichtdeklarierter Bezeichner
c:\...\ultris.cpp(42) : error C2065: 'CW_USERDEFAULT' : nichtdeklarierter Bezeichner
c:\...\ultris.cpp(52) : error C2440: '=' : 'int' kann nicht in 'struct HINSTANCE__ *' konvertiert werden
        Die Konvertierung eines ganzzahligen Typs in einen Zeigertyp erfordert ein reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat
c:\...\ultris.cpp(74) : error C2601: 'ultris_windowhandler' : Lokale Funktionsdefinitionen sind unzulaessig
</code></pre>
<p>EDIT: Wies scheint ist dieser Code von Grund auf widersprüchlich und falsch ^^ ich schau, ob ich was besseres find.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1495735</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1495735</guid><dc:creator><![CDATA[Andraste]]></dc:creator><pubDate>Mon, 21 Apr 2008 17:37:57 GMT</pubDate></item><item><title><![CDATA[Reply to Darstellung eines Windows Forms mit bestimmer Größe (some Errors) on Mon, 21 Apr 2008 17:23:38 GMT]]></title><description><![CDATA[<p>Andraste schrieb:</p>
<blockquote>
<pre><code>c:\...\ultris.cpp(42) : error C2065: 'CW_USERDEFAULT' : nichtdeklarierter Bezeichner
</code></pre>
</blockquote>
<p>Ist zwar nur eine sehr kleine Hilfe aber:<br />
Das müsste soviel ich weiss CW_USEDEFAULT heissen, ohne R.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1495786</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1495786</guid><dc:creator><![CDATA[Dave__R]]></dc:creator><pubDate>Mon, 21 Apr 2008 17:23:38 GMT</pubDate></item><item><title><![CDATA[Reply to Darstellung eines Windows Forms mit bestimmer Größe (some Errors) on Mon, 21 Apr 2008 17:44:48 GMT]]></title><description><![CDATA[<p>Ou ja ... ich hab das ganze jetzt auf einen Fehler reduzieren können xD</p>
<pre><code>ultris.cpp(74) : error C2601: 'ultris_windowhandler' : Lokale Funktionsdefinitionen sind unzulaessig
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1495798</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1495798</guid><dc:creator><![CDATA[Andraste]]></dc:creator><pubDate>Mon, 21 Apr 2008 17:44:48 GMT</pubDate></item></channel></rss>