Solved

'class' type redefinition

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now