Advertisement

Visual C++ 6.0 WTF?

Started by March 06, 2000 03:56 PM
12 comments, last by cclements 24 years, 9 months ago
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
~ 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. ~
Advertisement
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( ); 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
><>
-- What would Sweetness do?
Advertisement
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.
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
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
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
I''ve seen people complain about this error about a hundred times. It''s not even an error. Don''t they teach typecasting in school anymore?

"That which the flame does not consume...consumes the flame. "
"That which the flame does not consume...consumes the flame. "

This topic is closed to new replies.

Advertisement