Click here to Skip to main content
16,011,997 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Convert code from VS6.0 to VC 1.52 Pin
KeithF18-Mar-08 5:43
KeithF18-Mar-08 5:43 
QuestionRe: Convert code from VS6.0 to VC 1.52 Pin
David Crow18-Mar-08 5:54
David Crow18-Mar-08 5:54 
GeneralRe: Convert code from VS6.0 to VC 1.52 Pin
KeithF18-Mar-08 6:01
KeithF18-Mar-08 6:01 
GeneralRe: Convert code from VS6.0 to VC 1.52 Pin
Chris Meech18-Mar-08 7:32
Chris Meech18-Mar-08 7:32 
GeneralRe: Convert code from VS6.0 to VC 1.52 Pin
David Crow18-Mar-08 9:46
David Crow18-Mar-08 9:46 
GeneralRe: Convert code from VS6.0 to VC 1.52 Pin
Joe Woodbury18-Mar-08 16:09
professionalJoe Woodbury18-Mar-08 16:09 
Questionwhy does mouse dispear in CRectTracker? Pin
includeh1018-Mar-08 4:39
includeh1018-Mar-08 4:39 
GeneralDifferent methods in objects in a List Pin
piul18-Mar-08 1:54
piul18-Mar-08 1:54 
Hi there,

I have a list in which each Node holds an object of the class CItem
<pre></pre>
class CList{
...
CNode * mpListHead; };

class CNode{
double GetPos() const { return mpItem->GetPos(); }
...
CItem * mpItem; };

class CItem{
double GetPos() const { return mdPosition; }
...
double mdPosition; };

Each Item can be of a different type
class CEmboss : public CItem {...};
class CAnneal : public CItem {...};

And some of the items need to have some member data and functions that are not required in the rest, for example:
class CEmboss : public CItem {
...
int GetOrientation() const  { return mnOrient; }
...
int mnOrient;  };

The question is, how do I implement a GetOrientation() function in CNode??
I get a compiler error when mpItem->GetOrientation() because some of the Items don't have this method.
One option is to put that function in CItem, even though it won't be used for some of the Items, but I'd prefer to put it only in CEmboss. Is there any way of doing this??
GeneralRe: Different methods in objects in a List Pin
Cedric Moonen18-Mar-08 2:18
Cedric Moonen18-Mar-08 2:18 
GeneralRe: Different methods in objects in a List Pin
Hanan88818-Mar-08 2:34
Hanan88818-Mar-08 2:34 
GeneralRe: Different methods in objects in a List Pin
piul18-Mar-08 2:43
piul18-Mar-08 2:43 
GeneralRe: Different methods in objects in a List Pin
BadKarma18-Mar-08 2:54
BadKarma18-Mar-08 2:54 
GeneralRe: Different methods in objects in a List Pin
Cedric Moonen18-Mar-08 3:11
Cedric Moonen18-Mar-08 3:11 
GeneralRe: Different methods in objects in a List Pin
CPallini18-Mar-08 5:11
mveCPallini18-Mar-08 5:11 
GeneralRe: Different methods in objects in a List Pin
Cedric Moonen18-Mar-08 5:34
Cedric Moonen18-Mar-08 5:34 
GeneralRe: Different methods in objects in a List Pin
Hanan88818-Mar-08 3:15
Hanan88818-Mar-08 3:15 
GeneralRe: Different methods in objects in a List Pin
BadKarma18-Mar-08 2:45
BadKarma18-Mar-08 2:45 
QuestionRe: Different methods in objects in a List Pin
CPallini18-Mar-08 3:00
mveCPallini18-Mar-08 3:00 
GeneralRe: Different methods in objects in a List [modified] Pin
Member 75496020-Mar-08 5:25
Member 75496020-Mar-08 5:25 
GeneralDrawing pictures c++ win32 Pin
Hanan88818-Mar-08 1:45
Hanan88818-Mar-08 1:45 
QuestionRe: Drawing pictures c++ win32 Pin
David Crow18-Mar-08 3:25
David Crow18-Mar-08 3:25 
GeneralRe: Drawing pictures c++ win32 Pin
Hanan88818-Mar-08 3:33
Hanan88818-Mar-08 3:33 
GeneralRe: Drawing pictures c++ win32 Pin
Mark Salsbery18-Mar-08 7:06
Mark Salsbery18-Mar-08 7:06 
Generalchar * to TCHAR Pin
Royaltvk18-Mar-08 1:40
Royaltvk18-Mar-08 1:40 
GeneralRe: char * to TCHAR PinPopular
CPallini18-Mar-08 1:59
mveCPallini18-Mar-08 1:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.