Game programming

Moderators: None (Apply to moderate this forum)
Number of threads: 2070
Number of posts: 5361

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Need help with GUI programing! Posted by elfish on 8 Nov 2001 at 12:05 PM
Hi
I'm a newbee to windows graphic programming and i have bought a book called Windows game programming for dummies.
And it is really good, except for one little problem.
Some of the directx example files wont compile for me :(
Have tried both borland 5.02 and visual c++ 6.0.
The problem is the same each time in a number of diffrent files

\\c++\gpchap12\starferr.cpp(216) : error C2440: '=' : cannot convert from 'void *' to 'struct HBRUSH__ *'
Conversion from 'void*' to pointer to non-'void' requires an explicit cast
?? this line is giving me a bit of an hedace, what is wrong...
plz help me!

Report
Re: Need help with GUI programing! Posted by gautam on 9 Nov 2001 at 9:50 AM
: Hi
: I'm a newbee to windows graphic programming and i have bought a book called Windows game programming for dummies.
: And it is really good, except for one little problem.
: Some of the directx example files wont compile for me :(
: Have tried both borland 5.02 and visual c++ 6.0.
: The problem is the same each time in a number of diffrent files
:
: \\c++\gpchap12\starferr.cpp(216) : error C2440: '=' : cannot convert from 'void *' to 'struct HBRUSH__ *'
: Conversion from 'void*' to pointer to non-'void' requires an explicit cast
: ?? this line is giving me a bit of an hedace, what is wrong...
: plz help me!
:

Thats because it has to be typecasted to type HBRUSH
Edit that line and make it (HBRUSH)GetStockObject(whatever_here);
Just add (HBRUSH) and nothing else, then compile.


Report
Re: Need help with GUI programing! Posted by elfish on 9 Nov 2001 at 10:49 AM
: Thats because it has to be typecasted to type HBRUSH
: Edit that line and make it (HBRUSH)GetStockObject(whatever_here);
: Just add (HBRUSH) and nothing else, then compile.
:
:


It worked!
Tanx a lot!!!

Report
got some more problems Posted by elfish on 9 Nov 2001 at 11:22 AM
got some more problems...

HDC hdc; // generic dc
PAINTSTRUCT ps; // generic paintstruct



\c++\Source\Gpchap9\Prog9_1.cpp(127) : warning C4101: 'ps' : unreferenced local variable

\c++\Source\Gpchap9\Prog9_1.cpp(126) : warning C4101: 'hdc' : unreferenced local variable

hope you can help me as easy as the last one :)

Report
Re: got some more problems Posted by gautam on 9 Nov 2001 at 7:28 PM
: got some more problems...
:
: HDC hdc; // generic dc
: PAINTSTRUCT ps; // generic paintstruct
:
:
:
: \c++\Source\Gpchap9\Prog9_1.cpp(127) : warning C4101: 'ps' : unreferenced local variable
:
: \c++\Source\Gpchap9\Prog9_1.cpp(126) : warning C4101: 'hdc' : unreferenced local variable
:
: hope you can help me as easy as the last one :)
:
Those are warnings because those 2(ps & hdc) are never used in the whole program. You don't have to worry about it. If its concerning you too much then you can comment the two.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.