<?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[Hersteller SDK zur kommunikation mit einer Kamera ruft Compilererror error C2059: syntax error : &#x27;if&#x27; hervor.]]></title><description><![CDATA[<p>Hallo,</p>
<p>habe ein Testskript der Hersteller SDK via Copy und Paste einfach mal kompilieren wollen.</p>
<pre><code class="language-cpp">#include &quot;VCamServer.c&quot;
#include &quot;VCamServer.h&quot;

IVirtualCam* pVirtualCam;

// Initialize COM library
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (FAILED(hr)) //if initialization fails then exit
{
AfxMessageBox(&quot;Failed to initialize COM library&quot;);
}
pVirtualCam = NULL;
//create the com
hr = CoCreateInstance( CLSID_CVirtualCam, NULL,
CLSCTX_LOCAL_SERVER ,IID_IVirtualCam,
(void**) &amp;pVirtualCam);
</code></pre>
<p>Fehlercode: error C2059: syntax error : 'if'<br />
Was kann den bitteschön an if falsch sein? Ich denke nicht das der Fehler davon ausgelöst wird. Hat von euch jemand eine Idee?</p>
<p>Wenn ich ab Zeile 8 auskommentiere funktionierts.</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/245033/hersteller-sdk-zur-kommunikation-mit-einer-kamera-ruft-compilererror-error-c2059-syntax-error-if-hervor</link><generator>RSS for Node</generator><lastBuildDate>Sat, 19 Sep 2026 00:33:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/245033.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Jul 2009 10:01:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hersteller SDK zur kommunikation mit einer Kamera ruft Compilererror error C2059: syntax error : &#x27;if&#x27; hervor. on Thu, 09 Jul 2009 10:01:59 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>habe ein Testskript der Hersteller SDK via Copy und Paste einfach mal kompilieren wollen.</p>
<pre><code class="language-cpp">#include &quot;VCamServer.c&quot;
#include &quot;VCamServer.h&quot;

IVirtualCam* pVirtualCam;

// Initialize COM library
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (FAILED(hr)) //if initialization fails then exit
{
AfxMessageBox(&quot;Failed to initialize COM library&quot;);
}
pVirtualCam = NULL;
//create the com
hr = CoCreateInstance( CLSID_CVirtualCam, NULL,
CLSCTX_LOCAL_SERVER ,IID_IVirtualCam,
(void**) &amp;pVirtualCam);
</code></pre>
<p>Fehlercode: error C2059: syntax error : 'if'<br />
Was kann den bitteschön an if falsch sein? Ich denke nicht das der Fehler davon ausgelöst wird. Hat von euch jemand eine Idee?</p>
<p>Wenn ich ab Zeile 8 auskommentiere funktionierts.</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1739590</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1739590</guid><dc:creator><![CDATA[abrissbirne]]></dc:creator><pubDate>Thu, 09 Jul 2009 10:01:59 GMT</pubDate></item><item><title><![CDATA[Reply to Hersteller SDK zur kommunikation mit einer Kamera ruft Compilererror error C2059: syntax error : &#x27;if&#x27; hervor. on Thu, 09 Jul 2009 10:17:47 GMT]]></title><description><![CDATA[<p>abrissbirne schrieb:</p>
<blockquote>
<pre><code class="language-cpp">HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (FAILED(hr)) //if initialization fails then exit
{
AfxMessageBox(&quot;Failed to initialize COM library&quot;);
}
</code></pre>
</blockquote>
<p>Ersetze mal das FAILED(hr) durch</p>
<pre><code>((HRESULT)(hr)) &lt; 0
</code></pre>
<p>Wenn es dann funktioniert, dann hast Du ein Problem mit dem Makro FAILED. Vielleicht irgendein #include vergessen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1739599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1739599</guid><dc:creator><![CDATA[jencas]]></dc:creator><pubDate>Thu, 09 Jul 2009 10:17:47 GMT</pubDate></item><item><title><![CDATA[Reply to Hersteller SDK zur kommunikation mit einer Kamera ruft Compilererror error C2059: syntax error : &#x27;if&#x27; hervor. on Thu, 09 Jul 2009 10:52:23 GMT]]></title><description><![CDATA[<p>Ist auch nochmal in der MSDN sehr schön zu finden:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms693474(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms693474(VS.85).aspx</a></p>
<p>EDIT:<br />
Kommt aus der Winerror.h, vielleicht vergessen zu inkludieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1739629</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1739629</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Thu, 09 Jul 2009 10:52:23 GMT</pubDate></item><item><title><![CDATA[Reply to Hersteller SDK zur kommunikation mit einer Kamera ruft Compilererror error C2059: syntax error : &#x27;if&#x27; hervor. on Thu, 09 Jul 2009 11:13:43 GMT]]></title><description><![CDATA[<p>Danke schonmal für eure Vorschläge. Winerror.h hab ich inkludiert und auch FAILED durch ((HRESULT)(hr)) &lt; 0 zu ersetzen führt nicht zur Lösung. Fehlermeldung bleibt die gleiche.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1739648</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1739648</guid><dc:creator><![CDATA[abrissbirne]]></dc:creator><pubDate>Thu, 09 Jul 2009 11:13:43 GMT</pubDate></item><item><title><![CDATA[Reply to Hersteller SDK zur kommunikation mit einer Kamera ruft Compilererror error C2059: syntax error : &#x27;if&#x27; hervor. on Thu, 09 Jul 2009 13:41:14 GMT]]></title><description><![CDATA[<p><code>#include &quot;VCamServer.h&quot;</code> -&gt; hier ne klammer oder nen semikolon vergessen? irgend so etwas in der richtung wird es sein <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>
<p>bb</p>
<p>PS: <code>#include &quot;VCamServer.c&quot;</code> warum includierst du ne *.c datei? Oo</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1739759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1739759</guid><dc:creator><![CDATA[unskilled]]></dc:creator><pubDate>Thu, 09 Jul 2009 13:41:14 GMT</pubDate></item><item><title><![CDATA[Reply to Hersteller SDK zur kommunikation mit einer Kamera ruft Compilererror error C2059: syntax error : &#x27;if&#x27; hervor. on Thu, 09 Jul 2009 13:49:56 GMT]]></title><description><![CDATA[<p>Wie wäre es, wenn du mal die iostream inkludieren würdest?^^</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1739762</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1739762</guid><dc:creator><![CDATA[Kóyaánasqatsi]]></dc:creator><pubDate>Thu, 09 Jul 2009 13:49:56 GMT</pubDate></item><item><title><![CDATA[Reply to Hersteller SDK zur kommunikation mit einer Kamera ruft Compilererror error C2059: syntax error : &#x27;if&#x27; hervor. on Thu, 09 Jul 2009 15:38:07 GMT]]></title><description><![CDATA[<blockquote>
<p>Was kann den bitteschön an if falsch sein? Ich denke nicht das der Fehler davon ausgelöst wird. Hat von euch jemand eine Idee?</p>
</blockquote>
<p>Wenn ein Syntaxerror vorliegt, heißt das dass schon der Parser aussteigt. Wenn der Syntaxerror an einer Stelle ist, wo eigentlich alles in Ordnung ist, dann hats vorher irgendwo einen Fehlergegeben und der Parser hat sich in einem falschen Zustand noch ein Stück weiterschleppen können bevor er dann beim if ganz aussteigt. Der Fehler dürfte irgendwo im HRESULT oder COINIT_MULTITHREADED-Makro liegen. Lass mal nur den Präprozessor drüberlaufen und schau dir dessen Ausgabe an (vorsicht, könnte wegen der #includes recht lang sein).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1739845</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1739845</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 09 Jul 2009 15:38:07 GMT</pubDate></item></channel></rss>