?
Solved

'class' type redefinition

Posted on 2003-10-28
2
Medium Priority
?
1,571 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 2000 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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

765 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