include non-MFC classes 
Author Message
 include non-MFC classes

I need to use a set of non-MFC classes in my MFC application.  All of
the class definitions and
implementations are located in "myclass.cpp".  However, whenever I
include this file I get the following:
fatal error C1010: unexpected end of file while looking for precompiled
header directive

I put the line
#include "myclass.cpp"
at the top of "myapp.cpp", however I'm not sure this is where it should
go because I intend to use the classes in "myclass.cpp" in a MFC
document class.

Thank you,
Kenneth Massey



Sun, 30 Jul 2000 03:00:00 GMT  
 include non-MFC classes

This is a problem related to the precompiled headers feature.  When that
feature is turned on (the default) the first statement in every cpp file
must be
#include "stdafx.h".  That line is like a bookmark and the compiler
ignores everything prior to it.

Quote:

> I need to use a set of non-MFC classes in my MFC application.  All of
> the class definitions and
> implementations are located in "myclass.cpp".  However, whenever I
> include this file I get the following:
> fatal error C1010: unexpected end of file while looking for precompiled
> header directive

> I put the line
> #include "myclass.cpp"
> at the top of "myapp.cpp", however I'm not sure this is where it should
> go because I intend to use the classes in "myclass.cpp" in a MFC
> document class.

> Thank you,
> Kenneth Massey



Sun, 30 Jul 2000 03:00:00 GMT  
 include non-MFC classes

Funny,
I just ran into that today.  What you need to do is highlight the module in the workspace window and
right click on it.  You can then set the build options for it.  In the drop down list find
precompiled headers and turn them off for that file.  That will solve the error your getting.

Just remember that a lot of definitions from windows.h are included with stdafx.h.

Good Luck

Jeff



Sun, 30 Jul 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. dll with non-mfc classes

2. General - Creating non-MFC classes

3. Non-MFC example of Edit class?

4. Problem adding non-MFC Classes to project

5. A WinProc within a Non-MFC Class

6. Add text to control from non-MFC class

7. Non-Window Window with MFC classes??

8. Including a MFC-Class into a Programm?

9. Including MFC classes in DLL project

10. Including mfc classes

11. MFC with classwizard but non-SDI, non-MDI

12. How to include CRecordset without including MFC?

 

 
Powered by phpBB® Forum Software