Problems with CFile and MFC objects

Started by
7 comments, last by QBRADQ 22 years, 7 months ago
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?
Tell him about the twinky...
Advertisement
Is this an MFC project? You almost definitely need stdafx.h and the first include in every .CPP file.
Yea, sorry I forgot to format the includes. Anyho, that sounds like it should work. Thanks.
Tell him about the twinky...
Ok, that worked. Now what do I link to?
Tell him about the twinky...
- 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.
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.
Tell him about the twinky...
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.
sorry, didnt notice that was already suggested, but i think that would work too.
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.

This topic is closed to new replies.

Advertisement