Visual C++ 6.0 WTF?
I was trying to write a base application with visual c 6.0
I was filling the members of the NWDCLASS struct with
winclass.hbrBackground = GetStockObject(BLACK_BRUSH);
We all know this paints the window surface black. Well no way! In visual C++ 6.0 this line gets you a nasty error.
error C2440: ''='' : cannot convert from ''void *'' to ''struct HBRUSH__ *'' Conversion from ''void*'' to pointer to non-''void'' requires an explicit cast
I loaded some old code I have been using for years with the same line and pow the same error. This has to be specific to Visual C++ 6.0.
I did get some results trying this
winclass.hbrBackground = (HBRUSH)4;
Any ideas how to get back my ability to paint a window black?
No signature files!!! =)
Yes, Visual C++ 6.0 is a LOT pickier than earlier version about types. Annoying but easily fixed. You just need to cast to the correct type and you''ll be fine.
winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
Should work.
-fel
winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
Should work.
-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Thanks that took less than five minutes to get the answer I was looking for.
No signature files!!! =)
Does the VC++ 6.0 compiler offer anything new over the VC++ 5.0 compiler? If not, or if it offers nothing new that you''ll be using, you might as well save a backup of Visual C++ 6.0\bin\cl.exe and then replace it with your old cl.exe . That way your old code will still work.
~CGameProgrammer( );
~CGameProgrammer( );
~CGameProgrammer( );
Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
I''m pretty sure the 6.0 compiler has better optomizations. Plus, the project option command line params might have changed between the versions, so it''s probably better to keep the new compiler, and evolve your code with the compiler version.
Also uses IntelliSense.....if you don''t know what that is, let''s say you have
class A
{
int a;
};
...
A var;
now if you type ''var." a little window will pop up displaying the members of the A class. Also, with functions it will show you all of the different paramaters.
I don''t think I could have adapted to my Java programming class so easily without this.
"Why am I the only one on the away team with a red shirt!?"
BASSOFeeSH
><>
class A
{
int a;
};
...
A var;
now if you type ''var." a little window will pop up displaying the members of the A class. Also, with functions it will show you all of the different paramaters.
I don''t think I could have adapted to my Java programming class so easily without this.
"Why am I the only one on the away team with a red shirt!?"
BASSOFeeSH
><>
-- What would Sweetness do?
The intellisense is not actually part of the compiler, so replacing the CL.exe won''t affect that.
However, you might lose debugging facilities, because those have changed, and the development environment will most likely pass unrecognised switches to the compiler.
As to "better optimisations", I''ve just read a post on FlipCode where someone claimed that their 50fps demo dropped to 9fps after recompiling the same code with VC6.0
You''ll just have to try it.
However, you might lose debugging facilities, because those have changed, and the development environment will most likely pass unrecognised switches to the compiler.
As to "better optimisations", I''ve just read a post on FlipCode where someone claimed that their 50fps demo dropped to 9fps after recompiling the same code with VC6.0
You''ll just have to try it.
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
March 07, 2000 06:21 AM
yeah, it was my friend thos whos code suddenly stopped working at 50fps and dropped to 9fps, it was weird, cause I''ve been around his house and seen it in action, copy the project, compile with VC5, get 50fps, compile copied proj with VC6, get 9fps ??
dont know why
dont know why
March 07, 2000 06:22 AM
hello again, thos''s friend
forgot to ask, if you solve this little conundrem, please email me on chris_thomas@hotmail.com
thanks for all your help
help on why surface->flip() takes up 67% of process execution time when the program is profiled ?? that would help as well hehe
forgot to ask, if you solve this little conundrem, please email me on chris_thomas@hotmail.com
thanks for all your help
help on why surface->flip() takes up 67% of process execution time when the program is profiled ?? that would help as well hehe
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement