Click here to Skip to main content
15,917,455 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: wanna do animation, please help Pin
Chris Losinger3-Jun-02 15:33
professionalChris Losinger3-Jun-02 15:33 
GeneralRe: wanna do animation, please help Pin
Paul M Watt3-Jun-02 16:09
mentorPaul M Watt3-Jun-02 16:09 
GeneralRe: wanna do animation, please help Pin
Chris Losinger3-Jun-02 16:11
professionalChris Losinger3-Jun-02 16:11 
GeneralRe: wanna do animation, please help Pin
Paul M Watt3-Jun-02 8:36
mentorPaul M Watt3-Jun-02 8:36 
QuestionHow to specify a custom baud rate with using MSCOMM ctrl? Pin
3-Jun-02 7:11
suss3-Jun-02 7:11 
AnswerRe: How to specify a custom baud rate with using MSCOMM ctrl? Pin
Ed Gadziemski3-Jun-02 10:56
professionalEd Gadziemski3-Jun-02 10:56 
QuestionMagnus H -> How do i get the IShellFOlder interface for the current folder in the loop? Pin
redeemer3-Jun-02 6:50
redeemer3-Jun-02 6:50 
GeneralStrange compilation errors Pin
moredip3-Jun-02 6:20
moredip3-Jun-02 6:20 
OK, I'm tearing my hair out over this one...

I've got a project with 2 .cpp files, both of which #include a .h file. All is well in the world. I add a second .h file (4dlist.h), for a template class. All is still well in the world. I then add a new .cpp file, with the single line #include "4DList.h", and now I start getting wierd compile errors.

So to recap, I have the following files:

CenFilter.cpp
CenWriter.cpp
foo.cpp
CenFilter.h
4DList.h

when foo is empty, everything works. when #includes 4DList.h I get errors.

here is the start of 4dlist.h:


template <class TYPE> class C4DList  
{
public:
	C4DList( UINT MaxSize = 1000 );
	virtual ~C4DList();
	C4DList( const C4DList &Copy );
	void operator=( const C4DList &op2 );

	UINT GetSize(){return m_ListSize;}

	void AddTail( TYPE *pData );
	TYPE *GetAt( UINT index );
	void RemoveAt( UINT index );
	void RemoveCurrentIt();//remove at the previous iterator value;
	void RemoveAll();
	void DeleteAllData();

	void ItStart();
	TYPE *ItNext();
...
...
...


So CenFilter.h has #include 4dlist.h and is fine.

but if foo.cpp has the single line it throws up:


Compiling...
foo.cpp
C:\Pete\Capture\CenFilter\CenReadFilter\4dlist.h(12) : error C2629: unexpected 'class C4DList<type> ('
C:\Pete\Capture\CenFilter\CenReadFilter\4dlist.h(51) : see reference to class template instantiation 'C4DList<type>' being compiled
C:\Pete\Capture\CenFilter\CenReadFilter\4dlist.h(12) : error C2238: unexpected token(s) preceding ';'
C:\Pete\Capture\CenFilter\CenReadFilter\4dlist.h(51) : see reference to class template instantiation 'C4DList<type>' being compiled
C:\Pete\Capture\CenFilter\CenReadFilter\4dlist.h(17) : error C2146: syntax error : missing ';' before identifier 'GetSize'
...
...


Now I REALLY don't get this. Oh, BTW, this isn't a standard appwizard project, it's adapted from an MSDN sample project.

I hope someone can help!

Pete
GeneralRe: Strange compilation errors Pin
moredip3-Jun-02 6:29
moredip3-Jun-02 6:29 
GeneralRe: Strange compilation errors Pin
Joaquín M López Muñoz3-Jun-02 6:29
Joaquín M López Muñoz3-Jun-02 6:29 
GeneralRe: Strange compilation errors Pin
moredip3-Jun-02 6:34
moredip3-Jun-02 6:34 
GeneralRe: Strange compilation errors Pin
Joaquín M López Muñoz3-Jun-02 6:35
Joaquín M López Muñoz3-Jun-02 6:35 
GeneralRe: Strange compilation errors Pin
moredip3-Jun-02 6:44
moredip3-Jun-02 6:44 
GeneralRe: Strange compilation errors Pin
Joaquín M López Muñoz3-Jun-02 6:47
Joaquín M López Muñoz3-Jun-02 6:47 
GeneralHandle to the window Pin
Mazdak3-Jun-02 5:36
Mazdak3-Jun-02 5:36 
GeneralString Manipulation Problem Pin
Sidney3-Jun-02 5:28
Sidney3-Jun-02 5:28 
GeneralRe: String Manipulation Problem Pin
Joaquín M López Muñoz3-Jun-02 6:33
Joaquín M López Muñoz3-Jun-02 6:33 
GeneralRe: String Manipulation Problem Pin
Sidney3-Jun-02 7:30
Sidney3-Jun-02 7:30 
GeneralRe: String Manipulation Problem Pin
Joaquín M López Muñoz3-Jun-02 7:57
Joaquín M López Muñoz3-Jun-02 7:57 
GeneralRe: String Manipulation Problem Pin
Bill Wilson3-Jun-02 6:33
Bill Wilson3-Jun-02 6:33 
GeneralRe: String Manipulation Problem Pin
Alexandru Savescu3-Jun-02 9:15
Alexandru Savescu3-Jun-02 9:15 
GeneralRe: String Manipulation Problem Pin
Michael Dunn3-Jun-02 18:39
sitebuilderMichael Dunn3-Jun-02 18:39 
QuestionLoad from resource instead from a file? Pin
3-Jun-02 5:25
suss3-Jun-02 5:25 
AnswerRe: Load from resource instead from a file? Pin
Chris Losinger3-Jun-02 5:24
professionalChris Losinger3-Jun-02 5:24 
GeneralRe: Thx Pin
3-Jun-02 5:45
suss3-Jun-02 5:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.