c++.windows.32-bits - CallWindowProc error
- Dimitri Kaparis (23/23) May 17 2002 Greetings,
- Walter (5/28) May 17 2002 One returns a long, the other returns an int. The prototypes should
- Dimitri Kaparis (8/42) May 17 2002 WNDPROC is the type of the first parameter of CallWindowProc and that is...
- Walter (8/54) May 17 2002 They're Microsoft header files. There are a number of inconsistencies in
Greetings, What's up with CallWindowProc, the following code fragment causes error: #include <windows.h> void main() { WNDPROC proc; HWND hwnd; UINT msg; WPARAM wparam; LPARAM lparam; ::CallWindowProc(proc,hwnd,msg,wparam,lparam); } sc Test.cpp -p -mn -C -WA -S -3 -a8 -c -gf -Ic:\dm\stl -oTest.obj Error: D:\MYPROJECTS\TEST\Test.cpp(10): need explicit cast for function parameter 1 to get D:\MYPROJECTS\TEST\Test.cpp(10): from: long (*std func)(void *,unsigned ,unsigned ,long ) D:\MYPROJECTS\TEST\Test.cpp(10): to : int (*__import std func)() Lines Processed: 124472 Errors: 1 Warnings: 0 Build failed Dimitri Kaparis, Independent Developer http://www.universalstudyhelper.com - software to help you study any subject.
May 17 2002
One returns a long, the other returns an int. The prototypes should match. -Walter "Dimitri Kaparis" <dkaparis universalstudyhelper.com> wrote in message news:ac2cs6$siq$1 digitaldaemon.com...Greetings, What's up with CallWindowProc, the following code fragment causes error: #include <windows.h> void main() { WNDPROC proc; HWND hwnd; UINT msg; WPARAM wparam; LPARAM lparam; ::CallWindowProc(proc,hwnd,msg,wparam,lparam); } sc Test.cpp -p -mn -C -WA -S -3 -a8 -c -gf -Ic:\dm\stl -oTest.obj Error: D:\MYPROJECTS\TEST\Test.cpp(10): need explicit cast for function parameter 1 to get D:\MYPROJECTS\TEST\Test.cpp(10): from: long (*std func)(void *,unsigned ,unsigned ,long ) D:\MYPROJECTS\TEST\Test.cpp(10): to : int (*__import std func)() Lines Processed: 124472 Errors: 1 Warnings: 0 Build failed Dimitri Kaparis, Independent Developer http://www.universalstudyhelper.com - software to help you study anysubject.
May 17 2002
WNDPROC is the type of the first parameter of CallWindowProc and that is exactly how it is declared in the headers. How come any difference? PS: I just found out that compiling with STRICT defined solves this problem, but this seems to be a bug. In article <ac3708$1hu1$1 digitaldaemon.com>, Walter says...One returns a long, the other returns an int. The prototypes should match. -Walter "Dimitri Kaparis" <dkaparis universalstudyhelper.com> wrote in message news:ac2cs6$siq$1 digitaldaemon.com...Dimitri Kaparis, Independent Developer http://www.universalstudyhelper.com - software to help you study any subject.Greetings, What's up with CallWindowProc, the following code fragment causes error: #include <windows.h> void main() { WNDPROC proc; HWND hwnd; UINT msg; WPARAM wparam; LPARAM lparam; ::CallWindowProc(proc,hwnd,msg,wparam,lparam); } sc Test.cpp -p -mn -C -WA -S -3 -a8 -c -gf -Ic:\dm\stl -oTest.obj Error: D:\MYPROJECTS\TEST\Test.cpp(10): need explicit cast for function parameter 1 to get D:\MYPROJECTS\TEST\Test.cpp(10): from: long (*std func)(void *,unsigned ,unsigned ,long ) D:\MYPROJECTS\TEST\Test.cpp(10): to : int (*__import std func)() Lines Processed: 124472 Errors: 1 Warnings: 0 Build failed Dimitri Kaparis, Independent Developer http://www.universalstudyhelper.com - software to help you study anysubject.
May 17 2002
They're Microsoft header files. There are a number of inconsistencies in them. "Dimitri Kaparis" <dkaparis universalstudyhelper.com> wrote in message news:ac3jhd$1t3r$1 digitaldaemon.com...WNDPROC is the type of the first parameter of CallWindowProc and that isexactlyhow it is declared in the headers. How come any difference? PS: I just found out that compiling with STRICT defined solves thisproblem, butthis seems to be a bug. In article <ac3708$1hu1$1 digitaldaemon.com>, Walter says...error:One returns a long, the other returns an int. The prototypes should match. -Walter "Dimitri Kaparis" <dkaparis universalstudyhelper.com> wrote in message news:ac2cs6$siq$1 digitaldaemon.com...Greetings, What's up with CallWindowProc, the following code fragment causessubject.Dimitri Kaparis, Independent Developer http://www.universalstudyhelper.com - software to help you study any#include <windows.h> void main() { WNDPROC proc; HWND hwnd; UINT msg; WPARAM wparam; LPARAM lparam; ::CallWindowProc(proc,hwnd,msg,wparam,lparam); } sc Test.cpp -p -mn -C -WA -S -3 -a8 -c -gf -Ic:\dm\stl -oTest.obj Error: D:\MYPROJECTS\TEST\Test.cpp(10): need explicit cast for function parameter 1 to get D:\MYPROJECTS\TEST\Test.cpp(10): from: long (*std func)(void *,unsigned ,unsigned ,long ) D:\MYPROJECTS\TEST\Test.cpp(10): to : int (*__import std func)() Lines Processed: 124472 Errors: 1 Warnings: 0 Build failed Dimitri Kaparis, Independent Developer http://www.universalstudyhelper.com - software to help you study anysubject.
May 17 2002