<?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[Classe die Dialog erstellt mehrfach aufrufen?]]></title><description><![CDATA[<p>Hallo,<br />
ich hab mir eine klasse erstellt in der mit CreateWindowEx ein Fenster erstellt werden soll. Diese Fenster soll so ähnich wie eine MessageBox fungieren. unter anderem 100 &amp; mehr mal nebeneinander aufgehen.</p>
<p>einmal das Fenster zu erstellen klappt, jedoch ein weiteres fenster öffnen wärend das eine noch offen ist geht nicht, da bricht mir das prog mit einer unbehandeleten ausnahme ab. und schreibt mir etwas (was ich nicht ganz versteh) das der _firstheap == dem _nextheap ist. <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>
<p>so erstelle ich das fenster</p>
<pre><code>HWND CCView::CreateDlg(HINSTANCE hInstance, HWND hWndParent, int nCmdShow,LPCTSTR lpszTitel, RECT *pRect)
{
	char szClassName[128];
	sprintf(szClassName,&quot;VIEW_%i&quot;,m_iCountView);
	m_iCountView++;

	RegisterClass(hInstance,(WNDPROC)CViewProc,szClassName,IDI_MAINICON,IDC_ARROW);//Registrier deine Classe

	HWND hWnd	=   CreateWindowEx(
                m_dwMainStyleEx,
                szClassName,				          
                lpszTitel,					             
                m_dwMainStyle,
                pRect-&gt;left,				  
				pRect-&gt;top,
				(pRect-&gt;right - pRect-&gt;left),
				(pRect-&gt;bottom - pRect-&gt;top),
                NULL,						      
                (HMENU)NULL,				       
				hInstance,				              
                NULL);                    

	::ShowWindow(hWnd, nCmdShow);

	return hWnd;
}
</code></pre>
<p>aufrufen tu ich die obere funktion so</p>
<pre><code>for(int iloop =0; iloop &lt;= 10;iloop++)
{
	RECT rc;
	rc.left		= 0 + (iloop*10);
	rc.top		= 0 + (iloop*10);
	rc.right	= 450 + (iloop*10);
	rc.bottom	= 400 + (iloop*10);

	HWND hWndParent = GetParent();
	HWND hWnd	= GetDlgItem();
	HINSTANCE hInstance = (HINSTANCE) GetWindowLong(hWndParent,GWL_HINSTANCE);

	CCView *pView = new CCView();
	HWND hView = pView-&gt;CreateDlg(hInstance,hWnd,SW_SHOW,lpszFilePath,&amp;rc);
	delete pView;

}
</code></pre>
<p>die eigenen funktionen GetParent, GetDlgItem &amp; lpszFilePath liefern jeweils den richtigen wert.</p>
<p>Kann mir dabei jemand helfen??<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/196613/classe-die-dialog-erstellt-mehrfach-aufrufen</link><generator>RSS for Node</generator><lastBuildDate>Sat, 02 May 2026 04:32:36 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/196613.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 31 Oct 2007 18:01:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Classe die Dialog erstellt mehrfach aufrufen? on Wed, 31 Oct 2007 18:01:48 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich hab mir eine klasse erstellt in der mit CreateWindowEx ein Fenster erstellt werden soll. Diese Fenster soll so ähnich wie eine MessageBox fungieren. unter anderem 100 &amp; mehr mal nebeneinander aufgehen.</p>
<p>einmal das Fenster zu erstellen klappt, jedoch ein weiteres fenster öffnen wärend das eine noch offen ist geht nicht, da bricht mir das prog mit einer unbehandeleten ausnahme ab. und schreibt mir etwas (was ich nicht ganz versteh) das der _firstheap == dem _nextheap ist. <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>
<p>so erstelle ich das fenster</p>
<pre><code>HWND CCView::CreateDlg(HINSTANCE hInstance, HWND hWndParent, int nCmdShow,LPCTSTR lpszTitel, RECT *pRect)
{
	char szClassName[128];
	sprintf(szClassName,&quot;VIEW_%i&quot;,m_iCountView);
	m_iCountView++;

	RegisterClass(hInstance,(WNDPROC)CViewProc,szClassName,IDI_MAINICON,IDC_ARROW);//Registrier deine Classe

	HWND hWnd	=   CreateWindowEx(
                m_dwMainStyleEx,
                szClassName,				          
                lpszTitel,					             
                m_dwMainStyle,
                pRect-&gt;left,				  
				pRect-&gt;top,
				(pRect-&gt;right - pRect-&gt;left),
				(pRect-&gt;bottom - pRect-&gt;top),
                NULL,						      
                (HMENU)NULL,				       
				hInstance,				              
                NULL);                    

	::ShowWindow(hWnd, nCmdShow);

	return hWnd;
}
</code></pre>
<p>aufrufen tu ich die obere funktion so</p>
<pre><code>for(int iloop =0; iloop &lt;= 10;iloop++)
{
	RECT rc;
	rc.left		= 0 + (iloop*10);
	rc.top		= 0 + (iloop*10);
	rc.right	= 450 + (iloop*10);
	rc.bottom	= 400 + (iloop*10);

	HWND hWndParent = GetParent();
	HWND hWnd	= GetDlgItem();
	HINSTANCE hInstance = (HINSTANCE) GetWindowLong(hWndParent,GWL_HINSTANCE);

	CCView *pView = new CCView();
	HWND hView = pView-&gt;CreateDlg(hInstance,hWnd,SW_SHOW,lpszFilePath,&amp;rc);
	delete pView;

}
</code></pre>
<p>die eigenen funktionen GetParent, GetDlgItem &amp; lpszFilePath liefern jeweils den richtigen wert.</p>
<p>Kann mir dabei jemand helfen??<br />
<img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1395462</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1395462</guid><dc:creator><![CDATA[*rT*f*Ct]]></dc:creator><pubDate>Wed, 31 Oct 2007 18:01:48 GMT</pubDate></item></channel></rss>