Jump to content
  • Advertisement
Sign in to follow this  
StubornAH

VC++ 2005 compile error C2061

This topic is 4704 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

The following lines get C2061 error "syntax error : identifier HWND" and the same for UINT class X protected: ... virtual int Init (HWND, const HWND, int, int, int, int) =0; ... virtual int UseWindow (UINT nHwnd) =0; Any ideas why? Those are the only macros in the prototypes and I don't get that error for the rest of the class. I get the same error in other classes but not for HINSTANCE. Thnx

Share this post


Link to post
Share on other sites
Advertisement
it means he compiler doesn't know what an HWND is. check your order of incluseion, or to be just safe include windows.h right before your class.

Share this post


Link to post
Share on other sites
That is what I thought at first too, but I noticed the error is "syntax error : identifier" not unknown identifier or whatever.

I did some research on MSDN and it says that it means that it is unexpected. Not that it is invalid or unknown, just unexpected. I tried their solutions but they are confusing and I couldn't get anything to work.

Share this post


Link to post
Share on other sites
Adding windows.h gets rid of the problem but does this include MFC in my code too? On MSDN it says, not that MSDN has been much help to me, but it says windows.h just includes something like afx.h which is labeled as MFC.

Share this post


Link to post
Share on other sites
Including windows.h fixes the problem because HWND and UINT are defined in a header file included by windows.h.

windows.h does not include any MFC headers.

Share this post


Link to post
Share on other sites
Thanks with that, now I have a new problem. I think my problem is VS 2005 because I have never had these strange errors before. But here is the new one.


DWORD m_dwHeight; // Screen Height
FILE* m_pLog; // Log file


I get error C2143, missing ; before *


thanks

Share this post


Link to post
Share on other sites
Why can't VS 2005 just say that FILE is undefined? I think it did in version 6.

Thanks for the help.


And sorry for the dumb questions, I have been programming in C on Unix machines for the past 6 months. Now I am coping C++ code from a book and I am having trouble remembering all the little things.

Share this post


Link to post
Share on other sites
I feel really stupid, but do I need to link something for DirectX types.

The code on the book's cd includes <d3d9.h>, which apparetly can't be found when I compile.

I looked it up and the type is in <d3d9types.h>, which can't be found either.

So, anyone got an obvious solution to this one.

Thanks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!