Solved

'class' type redefinition

Posted on 2003-10-28
2
1,567 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

770 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