Archived

This topic is now archived and is closed to further replies.

DirectInput

This topic is 5049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys, I had previously written a working directinput class, with initialization, shutdown, and keychecking functions. The problem was, I had this all written in a single header file, definitions and all. Now that I''m trying to move this out into a seperate source file, I get an annoying error. The HWND main_window handle gives me the error that ''HWND'': missing storage-class or type specifiers. Does anyone know what could cause this? Thanks.

Share this post


Link to post
Share on other sites
Your probably #defining the HWND variable after the place it is referenced. The order the files are looked at really matters in C and C++ (Personally I always thought that was stooopid because even in assembler on Amiga the compiler looked ahead).

I think the best solution is to keep all defines, globals and prototypes in headers or another c file that is included before any actual code.

Mark
Sound Effects For Game Developers
http://www.indiesfx.co.uk
Flatspace is here: The ultimate space adventure
http://www.lostinflatspace.com

Share this post


Link to post
Share on other sites
Include windows.h within the header for your class; it is include guarded so you can include it more than once in your program. If you dont want to do that, be sure to include windows.h before your header for your class.


Thanks Salsa!Colin Jeanne | Invader''s Realm
"I forgot I had the Scroll Lock key until a few weeks ago when some asshole program used it. It even used it right" - Conner McCloud

Share this post


Link to post
Share on other sites