<?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[Problem mit hWnd]]></title><description><![CDATA[<p>Hallöchen!!</p>
<p>Ich habe mittels CWnd ein Fenster erstellt und möchte darin ein Videostream darstellen. Probleme macht mir folgende Syntax (aus WMEncoder SDK9):</p>
<p>Link1:<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmencode/htm/iwmencprepreviewsetcaptureparent.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmencode/htm/iwmencprepreviewsetcaptureparent.asp</a></p>
<p>Link2:<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmencode/htm/iwmencprepreviewinterface.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmencode/htm/iwmencprepreviewinterface.asp</a></p>
<p>Ich weiss nicht wie ich mit &quot;long hWnd&quot; umgehen soll.</p>
<p>Hier mal mein Code:</p>
<pre><code>//Preview-Fenster

long  m_hWndPrePreview;
HWND  hWnd;

CWnd *pWindow;
pWindow = new CWnd;
pWindow-&gt;Create(_T(&quot;STATIC&quot;),&quot;&quot;,
         WS_CHILD | WS_VISIBLE | WS_BORDER | WS_THICKFRAME | WS_TABSTOP,
	CRect(2,38,242,218),this,1234);

hWnd = pWindow-&gt;GetSafeHwnd();
m_hWndPrePreview =  hWnd;
hr = pPrePreview-&gt;SetCaptureParent(m_hWndPrePreview);
</code></pre>
<p>folgender Fehler wird beim Kompilieren angezeigt:<br />
error C2440: '=' : 'struct HWND__ *' kann nicht in 'long' konvertiert werden<br />
Diese Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat</p>
<p>Hat jemand eine Idee wie ich das Problem lösen könnte?</p>
<p>Platform (Windows 2000, MSVisual C++ 6, SP5)</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/90453/problem-mit-hwnd</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 02:52:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/90453.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 29 Oct 2004 12:41:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit hWnd on Fri, 29 Oct 2004 12:41:12 GMT]]></title><description><![CDATA[<p>Hallöchen!!</p>
<p>Ich habe mittels CWnd ein Fenster erstellt und möchte darin ein Videostream darstellen. Probleme macht mir folgende Syntax (aus WMEncoder SDK9):</p>
<p>Link1:<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmencode/htm/iwmencprepreviewsetcaptureparent.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmencode/htm/iwmencprepreviewsetcaptureparent.asp</a></p>
<p>Link2:<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmencode/htm/iwmencprepreviewinterface.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmencode/htm/iwmencprepreviewinterface.asp</a></p>
<p>Ich weiss nicht wie ich mit &quot;long hWnd&quot; umgehen soll.</p>
<p>Hier mal mein Code:</p>
<pre><code>//Preview-Fenster

long  m_hWndPrePreview;
HWND  hWnd;

CWnd *pWindow;
pWindow = new CWnd;
pWindow-&gt;Create(_T(&quot;STATIC&quot;),&quot;&quot;,
         WS_CHILD | WS_VISIBLE | WS_BORDER | WS_THICKFRAME | WS_TABSTOP,
	CRect(2,38,242,218),this,1234);

hWnd = pWindow-&gt;GetSafeHwnd();
m_hWndPrePreview =  hWnd;
hr = pPrePreview-&gt;SetCaptureParent(m_hWndPrePreview);
</code></pre>
<p>folgender Fehler wird beim Kompilieren angezeigt:<br />
error C2440: '=' : 'struct HWND__ *' kann nicht in 'long' konvertiert werden<br />
Diese Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat</p>
<p>Hat jemand eine Idee wie ich das Problem lösen könnte?</p>
<p>Platform (Windows 2000, MSVisual C++ 6, SP5)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/640315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/640315</guid><dc:creator><![CDATA[TobiasW]]></dc:creator><pubDate>Fri, 29 Oct 2004 12:41:12 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit hWnd on Fri, 29 Oct 2004 12:45:38 GMT]]></title><description><![CDATA[<p>Wenn es mit SetCaptureParent(hWnd) nicht geht - einfach casten:</p>
<pre><code class="language-cpp">hr = pPrePreview-&gt;SetCaptureParent(reinterpret_cast&lt;long&gt;(hWnd))
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/640318</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/640318</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Fri, 29 Oct 2004 12:45:38 GMT</pubDate></item></channel></rss>