<?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 CListCtrl Create]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich hab bisher noch nie viel mit CListCtrl gemacht...!</p>
<p>Ich möchte ein List Control erstellen, dazua habe ich in meiner Header-Datei eine Member-Variable angelegt:</p>
<pre><code class="language-cpp">CListCtrl m_ListCtrl;
</code></pre>
<p>Nun möchte ich in einer Funktion, mit Create das Control erstellen:</p>
<pre><code class="language-cpp">DWORD dwStyle = LVS_AUTOARRANGE |
					LVS_EDITLABELS |
					LVS_REPORT |
					LVS_SHAREIMAGELISTS |
					LVS_SHOWSELALWAYS |
					LVS_SORTASCENDING ;

CWnd *pCWndParent;

pCWndParent = CWnd::FromHandle(hWnd);

if(!pThis-&gt;m_ListCtrl.Create(dwStyle, CRect(prcView), pCWndParent, LISTCTRLID))
	{
		::MessageBox(NULL, &quot;CListCtrl::Create failed.&quot;, &quot;Error:&quot;, MB_OK);
	}
</code></pre>
<p>hWnd und prcView werden der Funktion als Parameter übergeben und haben gültige Werte.</p>
<p>Wenn ich jetzt debugge und zu dieser Stelle komme, erhalte ich eine Debug-Assertion.</p>
<blockquote>
<p>Debug Assertion failed.</p>
<p>Programm: C:\winnt\eplorer.exe<br />
File: F:\vs70builds\3077\......\afxwin1.inl<br />
Line: 23</p>
</blockquote>
<p>Wenn ich nun auf &quot;Wiederholen&quot; klick, springt in die Funktion &quot;AfxEndDeferRegisterClass&quot; in &quot;wincore.cpp&quot;.</p>
<p>Hab nun leider keine Ahnung was ich falsch mache ... vl. könntet ihr mir helfen? Bin über jeden Tipp / Ansatz usw. froh.</p>
<p>Ich benutze <a href="http://VS.NET" rel="nofollow">VS.NET</a> 2003 und WIN2K.</p>
<p>Die Klasse, die diese Funktion beinhaltet ist von einem Interface abgeleitet (IShellView).</p>
<p>Danke schon mal</p>
<p>LG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/146212/probleme-mit-clistctrl-create</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 09:05:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/146212.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 05 May 2006 10:50:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit CListCtrl Create on Fri, 05 May 2006 10:50:50 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich hab bisher noch nie viel mit CListCtrl gemacht...!</p>
<p>Ich möchte ein List Control erstellen, dazua habe ich in meiner Header-Datei eine Member-Variable angelegt:</p>
<pre><code class="language-cpp">CListCtrl m_ListCtrl;
</code></pre>
<p>Nun möchte ich in einer Funktion, mit Create das Control erstellen:</p>
<pre><code class="language-cpp">DWORD dwStyle = LVS_AUTOARRANGE |
					LVS_EDITLABELS |
					LVS_REPORT |
					LVS_SHAREIMAGELISTS |
					LVS_SHOWSELALWAYS |
					LVS_SORTASCENDING ;

CWnd *pCWndParent;

pCWndParent = CWnd::FromHandle(hWnd);

if(!pThis-&gt;m_ListCtrl.Create(dwStyle, CRect(prcView), pCWndParent, LISTCTRLID))
	{
		::MessageBox(NULL, &quot;CListCtrl::Create failed.&quot;, &quot;Error:&quot;, MB_OK);
	}
</code></pre>
<p>hWnd und prcView werden der Funktion als Parameter übergeben und haben gültige Werte.</p>
<p>Wenn ich jetzt debugge und zu dieser Stelle komme, erhalte ich eine Debug-Assertion.</p>
<blockquote>
<p>Debug Assertion failed.</p>
<p>Programm: C:\winnt\eplorer.exe<br />
File: F:\vs70builds\3077\......\afxwin1.inl<br />
Line: 23</p>
</blockquote>
<p>Wenn ich nun auf &quot;Wiederholen&quot; klick, springt in die Funktion &quot;AfxEndDeferRegisterClass&quot; in &quot;wincore.cpp&quot;.</p>
<p>Hab nun leider keine Ahnung was ich falsch mache ... vl. könntet ihr mir helfen? Bin über jeden Tipp / Ansatz usw. froh.</p>
<p>Ich benutze <a href="http://VS.NET" rel="nofollow">VS.NET</a> 2003 und WIN2K.</p>
<p>Die Klasse, die diese Funktion beinhaltet ist von einem Interface abgeleitet (IShellView).</p>
<p>Danke schon mal</p>
<p>LG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1051422</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1051422</guid><dc:creator><![CDATA[ListCtrl]]></dc:creator><pubDate>Fri, 05 May 2006 10:50:50 GMT</pubDate></item></channel></rss>