• Advertisement

Archived

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

Problems with CFile and MFC objects

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

When I try to declair an object of CFile it gives me the class not declaired type error. Here are my system includes: #include #include #include #include #include #include What else do I need?

Share this post


Link to post
Share on other sites
Advertisement
Is this an MFC project? You almost definitely need stdafx.h and the first include in every .CPP file.

Share this post


Link to post
Share on other sites
Yea, sorry I forgot to format the includes. Anyho, that sounds like it should work. Thanks.

Share this post


Link to post
Share on other sites
- Create a new project
- Make it an MFC project instead of a win32 project, since that''s what you''re doing.

This will set up your project settings correctly. If you want to do it manually, you might try playing with that first tab under Project->Settings->General->Microsoft Foundation Classes.

Share this post


Link to post
Share on other sites
Well, that''s the think. I''m about 5000 lines into this thing and just did a MAJOR overhaul on my orginization, and I want to use MFC for file I/O.

Share this post


Link to post
Share on other sites
try going to the project, settings, and in the general tab, there should be a list box labeled "microsoft foundation classes", and change that to use mfc in a shared dll. im not sure if thats what you need or not.

Share this post


Link to post
Share on other sites
I wasn''t saying you should re-write all of your code. Just start a new project, and copy your code into the template files MFC builds for you. Or do it manually by turning on pre-compiled headers (automatic: stdafx.h) for all of your files and include stdafx.h as the first line in each .cpp file.

Share this post


Link to post
Share on other sites

  • Advertisement