Click here to Skip to main content
15,905,971 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pDlg->Create() hell in a dll Pin
Ravi Bhavnani25-Oct-02 9:33
professionalRavi Bhavnani25-Oct-02 9:33 
GeneralReadDirectoryChangesW() on a network drive Pin
Juan Carlos SM25-Oct-02 3:14
Juan Carlos SM25-Oct-02 3:14 
GeneralRe: ReadDirectoryChangesW() on a network drive Pin
Joel Lucsy25-Oct-02 3:34
Joel Lucsy25-Oct-02 3:34 
GeneralRe: ReadDirectoryChangesW() on a network drive Pin
Juan Carlos SM25-Oct-02 3:45
Juan Carlos SM25-Oct-02 3:45 
QuestionHow to send a customer HTTP request to a Web Server? Pin
George225-Oct-02 3:08
George225-Oct-02 3:08 
AnswerRe: How to send a customer HTTP request to a Web Server? Pin
Todd Smith25-Oct-02 6:55
Todd Smith25-Oct-02 6:55 
Questionhow to use a bmp in a toolbar button Pin
ns25-Oct-02 2:59
ns25-Oct-02 2:59 
GeneralGeneral C++ Inheritance Question Pin
Haakon S.25-Oct-02 2:11
Haakon S.25-Oct-02 2:11 
Lets say I want to do simulations on a group of animals of class CAnimal. First I define a group of dogs of class CDogs inheriting from CAnimals. Then I want to do the same with cats of class CCats, also inheriting from CAnimals, etc.

Lets say we have the following setup:

- A CAnimal object has member data and a set of pure virtual functions
- A CDog or CCat has only static member data in addition to member functions, including the virtual functions from CAnimal.

I would now like to have the ability to change between dogs and cats, i.e. redefine all my CAnimals from being dogs to cats. If I don't make my CDog and CCat destructors virtual, I can delete the dog/cat part and keep the CAnimal base class, but how can I change type?

I guess one way to do it is to take my array of dog objects and make a new array of cat objects and copy the animal part from dog to cat using assignement operator, and then delete may dog array. Or are there more elegant ways..?

Regards, Haakon S.
GeneralRe: General C++ Inheritance Question Pin
Maximilien25-Oct-02 2:32
Maximilien25-Oct-02 2:32 
GeneralRe: General C++ Inheritance Question Pin
Joaquín M López Muñoz25-Oct-02 2:49
Joaquín M López Muñoz25-Oct-02 2:49 
GeneralRe: General C++ Inheritance Question Pin
Haakon S.25-Oct-02 3:55
Haakon S.25-Oct-02 3:55 
GeneralRe: General C++ Inheritance Question Pin
Joaquín M López Muñoz25-Oct-02 4:27
Joaquín M López Muñoz25-Oct-02 4:27 
GeneralRe: General C++ Inheritance Question Pin
Maximilien25-Oct-02 4:36
Maximilien25-Oct-02 4:36 
GeneralRe: General C++ Inheritance Question Pin
Joe Woodbury25-Oct-02 6:52
professionalJoe Woodbury25-Oct-02 6:52 
GeneralMicrosoft SDK and VC++ integration question. Pin
Michael Liu25-Oct-02 2:09
Michael Liu25-Oct-02 2:09 
GeneralWindows Message Pin
Shamoon25-Oct-02 2:03
Shamoon25-Oct-02 2:03 
GeneralRe: Windows Message Pin
Maximilien25-Oct-02 2:33
Maximilien25-Oct-02 2:33 
GeneralRe: Windows Message Pin
Paul M Watt25-Oct-02 5:04
mentorPaul M Watt25-Oct-02 5:04 
GeneralRe: Windows Message Pin
pba_25-Oct-02 11:46
pba_25-Oct-02 11:46 
GeneralFont Calculation for a String . Pin
Muhammad Kamran25-Oct-02 1:40
Muhammad Kamran25-Oct-02 1:40 
GeneralRe: Font Calculation for a String . Pin
Daniel Turini25-Oct-02 2:24
Daniel Turini25-Oct-02 2:24 
GeneralRe: Font Calculation for a String . Pin
Muhammad Kamran25-Oct-02 2:39
Muhammad Kamran25-Oct-02 2:39 
GeneralRe: Font Calculation for a String . Pin
dabs25-Oct-02 3:40
dabs25-Oct-02 3:40 
General_tfullpath(..) for http:// paths Pin
Anonymous25-Oct-02 1:12
Anonymous25-Oct-02 1:12 
GeneralRe: _tfullpath(..) for http:// paths Pin
Anonymous25-Oct-02 2:15
Anonymous25-Oct-02 2:15 

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.