Solved

'class' type redefinition

Posted on 2003-10-28
2
1,568 Views
Last Modified: 2013-11-20
Hi

My app is a 4x4 splitter, with 4 Formviews (frmV1, frmV2, frmV3, frmV4), in frmV4 is a tab ctrl with 4 dialogs (dlg1, dlg2 dlg3, dlg4). Now in frmV1 I inserted a custom ctrl (KsVolumeDisplay)some time ago, and it has worked well, but now I inserted the control into dlg4 and used the class wiz to create a member var of type voulme display control, when I complie I get the following error msg

error C2011: 'CKsVolumeDisplay' : 'class' type redefinition

in 14 of my classes which points to

/////////////////////////////////////////////////////////////////////////////
// CKsVolumeDisplay wrapper class

class CKsVolumeDisplay : public CWnd   <<<<<<<This line

Now if I remove the #include "ksVolumeDisplay.h" from my dlg4.h it stops this error but of course I get
error C2079: 'm_xxxxxxxxx' uses undefined class 'CKsVolumeDisplay' (which I understand)
I don't understand why I'm getting the redefinition error and what to do to prevent it??
0
Comment
Question by:Dj_Fx8
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 9636563
It seems that you are including the same header file more than once - do you have "multiple inclusion guards" in it, e.g.

//ksVolumeDisplay.h:
#ifndef __ksVolumeDisplay_h
#define __ksVolumeDisplay_h

// rest of the header file goes here...

#endif

?
0
 

Author Comment

by:Dj_Fx8
ID: 9637327
Hi jkr

That has done the trick it now compiles and works, many thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
iSeries FTP Exit Program 8 161
Detect CR LF to each line 12 174
maxBlock challenge 30 145
matchUp  challenge 9 123
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli‚Ķ
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question