<?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[Zeiger auf Proc?]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich moechte gerne eine Funktion schreiben, die ein Fenster initialisiert. Dabei gebe ich einen Funktionszeiger auf die WinProc() mit.<br />
Der Funktionskopf sieht also so aus:</p>
<pre><code>int InitWindow(HINSTANCE hInst, WindowParameters *params, LRESULT CALLBACK (*WinProc)(HWND hwnd, UINT msg, LPARAM lparam, WPARAM wparam));
</code></pre>
<p>Ich bin noch nicht ganz so erfahren mit funktionszeigern, aber eigentlich muesste es doch so gehen oder?</p>
<p>Wenn ich es so mache bekomme ich folgende Fehlermeldungen:</p>
<pre><code>--------------------Configuration: my_utils - Win32 Debug--------------------
Compiling...
utils.cpp
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2059: syntax error : '*'
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2143: syntax error : missing ')' before '('
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2275: 'HWND' : illegal use of this type as an expression
        c:\development\vc98\include\windef.h(195) : see declaration of 'HWND'
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2146: syntax error : missing ')' before identifier 'hwnd'
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2072: 'InitWindow' : initialization of a function
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2059: syntax error : ')'
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2059: syntax error : ')'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2059: syntax error : '*'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2143: syntax error : missing ')' before '('
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2275: 'HWND' : illegal use of this type as an expression
        c:\development\vc98\include\windef.h(195) : see declaration of 'HWND'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2146: syntax error : missing ')' before identifier 'hwnd'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2374: 'InitWindow' : redefinition; multiple initialization
        f:\windows\programmiertes\my_utils\my_utils.h(37) : see declaration of 'InitWindow'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2059: syntax error : ')'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2059: syntax error : ')'
f:\windows\programmiertes\my_utils\utils.cpp(5) : error C2143: syntax error : missing ';' before '{'
f:\windows\programmiertes\my_utils\utils.cpp(5) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.

my_utils.lib - 16 error(s), 0 warning(s)
</code></pre>
<p>Ich habe schon eine kleine vermutung, und zwar das es an dem &quot;CALLBACK&quot; liegt.</p>
<p>Kann mir bitte jemand helfen?</p>
<p>mfg LastManStanding</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/115064/zeiger-auf-proc</link><generator>RSS for Node</generator><lastBuildDate>Thu, 02 Jul 2026 08:18:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/115064.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Jul 2005 07:06:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zeiger auf Proc? on Mon, 11 Jul 2005 07:06:17 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich moechte gerne eine Funktion schreiben, die ein Fenster initialisiert. Dabei gebe ich einen Funktionszeiger auf die WinProc() mit.<br />
Der Funktionskopf sieht also so aus:</p>
<pre><code>int InitWindow(HINSTANCE hInst, WindowParameters *params, LRESULT CALLBACK (*WinProc)(HWND hwnd, UINT msg, LPARAM lparam, WPARAM wparam));
</code></pre>
<p>Ich bin noch nicht ganz so erfahren mit funktionszeigern, aber eigentlich muesste es doch so gehen oder?</p>
<p>Wenn ich es so mache bekomme ich folgende Fehlermeldungen:</p>
<pre><code>--------------------Configuration: my_utils - Win32 Debug--------------------
Compiling...
utils.cpp
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2059: syntax error : '*'
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2143: syntax error : missing ')' before '('
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2275: 'HWND' : illegal use of this type as an expression
        c:\development\vc98\include\windef.h(195) : see declaration of 'HWND'
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2146: syntax error : missing ')' before identifier 'hwnd'
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2072: 'InitWindow' : initialization of a function
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2059: syntax error : ')'
f:\windows\programmiertes\my_utils\my_utils.h(37) : error C2059: syntax error : ')'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2059: syntax error : '*'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2143: syntax error : missing ')' before '('
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2275: 'HWND' : illegal use of this type as an expression
        c:\development\vc98\include\windef.h(195) : see declaration of 'HWND'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2146: syntax error : missing ')' before identifier 'hwnd'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2374: 'InitWindow' : redefinition; multiple initialization
        f:\windows\programmiertes\my_utils\my_utils.h(37) : see declaration of 'InitWindow'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2059: syntax error : ')'
f:\windows\programmiertes\my_utils\utils.cpp(4) : error C2059: syntax error : ')'
f:\windows\programmiertes\my_utils\utils.cpp(5) : error C2143: syntax error : missing ';' before '{'
f:\windows\programmiertes\my_utils\utils.cpp(5) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.

my_utils.lib - 16 error(s), 0 warning(s)
</code></pre>
<p>Ich habe schon eine kleine vermutung, und zwar das es an dem &quot;CALLBACK&quot; liegt.</p>
<p>Kann mir bitte jemand helfen?</p>
<p>mfg LastManStanding</p>
]]></description><link>https://www.c-plusplus.net/forum/post/828180</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/828180</guid><dc:creator><![CDATA[LastManStanding]]></dc:creator><pubDate>Mon, 11 Jul 2005 07:06:17 GMT</pubDate></item><item><title><![CDATA[Reply to Zeiger auf Proc? on Mon, 11 Jul 2005 07:20:18 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">int InitWindow(HINSTANCE hInst, WindowParameters *params, WNDPROC wndProc);
</code></pre>
<p>WNDPROC scheint dafür geeignet zu sein, zumindest wird das so in der WNDCLASSEX-Struktur benutzt <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=";D"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/828188</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/828188</guid><dc:creator><![CDATA[geeky]]></dc:creator><pubDate>Mon, 11 Jul 2005 07:20:18 GMT</pubDate></item><item><title><![CDATA[Reply to Zeiger auf Proc? on Mon, 11 Jul 2005 08:49:43 GMT]]></title><description><![CDATA[<p>OK Danke!<br />
Jetzt funktioniert es!</p>
<p>mfg LastManStanding</p>
]]></description><link>https://www.c-plusplus.net/forum/post/828263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/828263</guid><dc:creator><![CDATA[LastManStanding]]></dc:creator><pubDate>Mon, 11 Jul 2005 08:49:43 GMT</pubDate></item></channel></rss>