Solved

'class' type redefinition

Posted on 2003-10-28
2
1,569 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: 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
Replacement selected text 2 69
How to know only "File created" with EventLog 3 35
EvenOdd challenge 10 157
Not needed 13 133
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

731 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