CFile

Started by
4 comments, last by ape 23 years, 2 months ago
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.
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.
What are the pros and cons of using the C standard file manipulating functions that you mention vs. using fstreams?
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.

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
[Cyberdrek | ]
Stdio.h''s functions are often faster (not to mention smaller) than fstream.h''s though. I don''t know why, but it''s true in all of the tests I''ve done with them.


http://www.gdarchive.net/druidgames/

This topic is closed to new replies.

Advertisement