Jump to content
  • Advertisement

Archived

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

BenB

Won't reckognize CPoint...

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

I''m following the "Developing a GUI using C++ and DirectX" tutorial, but when I copied the following line: void ConstrainPosToScreenSize(CPoint ); and more with "CPoint", I get errors - it doesn''t know CPoint for some reason... Can anyone help me with what to do? Thanks, Ben

Share this post


Link to post
Share on other sites
Advertisement
learn C++ first? har har jk. is this a function prototype? you should be able to leave the argument name ambiguous like that (with just the data type being passed) so that''s no problem. are you sure CPoint is declared?

Share this post


Link to post
Share on other sites
If you''re not using MFC, then either make your own CPoint class or use the POINT structure with the Windows API. The only problem with using the POINT structure is that it doesn''t support the operator overloads, etc... of the CPoint. From the sound of your question, I suggest you get a book or two and start learning to program some C++ stuff first. You know, like the really basic hello world stuff. Then come back to this and it''ll seem much easier.

Share this post


Link to post
Share on other sites
But I have learned C++, also created some basic games (tetris, snake).

The error is the usual "Can''t reckognize something", will

error C2061: syntax error : identifier ''CPoint''

really help?

Thanks anyway.

Share this post


Link to post
Share on other sites
You shouldn''t really copy anything from that tutorial. It''s 98% pseudocode. The source listings are there just to give you an idea of what the algorithms or data structures should look like. Either code your own CPoint class, or use something else instead of CPoint, such as POINT, as was previously suggested.

~CGameProgrammer( );

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!