• Advertisement

Archived

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

CFile

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

Help please I need to use CFile of MFC, but when I #include , I get on of the following errors. LINK : fatal error LNK1104: cannot open file "nafxcwd.lib" c:\program files\microsoft visual studio\vc98\mfc\include\afxv_w32.h(14) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include I''ve got no clue.

Share this post


Link to post
Share on other sites
Advertisement
You can''t access MFC''s classes unless you link with their libraries and include afx.h and some other stuff.

If you are trying to borrow CFile for use in a non-MFC app, then I would advise using the C standard library''s fopen, fread, fwrite, fclose, etc. instead for manipulating files.

Share this post


Link to post
Share on other sites
What are the pros and cons of using the C standard file manipulating functions that you mention vs. using fstreams?

Share this post


Link to post
Share on other sites
Sorry, there was an omitted word in my original post:
I DO #include but when I do, I get those errors I mentioned.

What makes my project either a MFC or Non-MFC app? This is naturally, a game, and I''m useing directx 7, but I''d also like to use some of the CLists and other goodies found in MFC.

I''m trying the fread, and fwrite, they''re working, but I''m still curious.

Share this post


Link to post
Share on other sites
quote:
Original post by Redleaf

What are the pros and cons of using the C standard file manipulating functions that you mention vs. using fstreams?


They are equivalent, fstream is the standard file i/o for c++ where as fopen is the standard for C.





Cyberdrek
Headhunter Soft
DLC Multimedia

Share this post


Link to post
Share on other sites

  • Advertisement