Archived

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

zip7000

newbie problem

Recommended Posts

hi, I have a problem of compilation. here is the error message: g:\programmation\bouquin\justtriangle\form.h(17) : error C2146: syntax error : missing '';'' before identifier ''RestoreDeviceObjects'' I learn directx 9. I created an application using directx9 wizard and now I would like to create a class called CForm. This class has several functions. for instance : HRESULT RestoreDeviceObjects (); but HRESULT seems to be a problem. What should I include as header in CForm? thank you for your help!

Share this post


Link to post
Share on other sites
"g:\programmation\bouquin\justtriangle\form.h(17) : error C2146: syntax error : missing '';'' before
identifier ''RestoreDeviceObjects''"

It means the line befor Restore device objects is missing the ";"

And you have a space between "RestoreDeviceObjects" and "()" so the compiler thinks RestoreDeviceObjects is a variable instead of a function call.

Share this post


Link to post
Share on other sites
quote:
And you have a space between "RestoreDeviceObjects" and "()" so the compiler thinks RestoreDeviceObjects is a variable instead of a function call.


C++ doesn''t care about spacing, so this is quite legal.

It does look like somehow HRESULT is undefined. It''s a pretty integral COM typedef, so it should be defined by pretty much any header that uses COM. If you''re unsure, it''s in at least.

Share this post


Link to post
Share on other sites