Click here to Skip to main content
15,897,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Having a the processID how to get the application instance (HINSTANCE) ? Pin
Maxwell Chen3-Oct-07 0:11
Maxwell Chen3-Oct-07 0:11 
QuestionCustom ComboBox Control - Need Advice [modified] Pin
Leslie Sanford2-Oct-07 6:45
Leslie Sanford2-Oct-07 6:45 
QuestionRe: Custom ComboBox Control - Need Advice Pin
Mark Salsbery2-Oct-07 8:21
Mark Salsbery2-Oct-07 8:21 
AnswerRe: Custom ComboBox Control - Need Advice [modified] Pin
Leslie Sanford2-Oct-07 8:25
Leslie Sanford2-Oct-07 8:25 
QuestionUsing Abstract classes Pin
Apstolo2-Oct-07 3:40
Apstolo2-Oct-07 3:40 
AnswerRe: Using Abstract classes Pin
Cedric Moonen2-Oct-07 4:00
Cedric Moonen2-Oct-07 4:00 
GeneralRe: Using Abstract classes Pin
Apstolo2-Oct-07 4:31
Apstolo2-Oct-07 4:31 
GeneralRe: Using Abstract classes [modified] Pin
Cedric Moonen2-Oct-07 4:37
Cedric Moonen2-Oct-07 4:37 
Apstolo wrote:
But you dind't answerd to my question.


Yes I did, I even gave you a snippet of code Smile | :)


Apstolo wrote:
The problem is that wen the method ends it destroys the aux and the reference/adress is lost
and then is an obvius error when i will try to access that adress.


That's why you should use a pointer and create the object with new (like I showed in my example). But don't forget to delete the objects when you empty your container.
The reason is because the object is local to your function and will be destroyed when the function exits.


Apstolo wrote:
The only way tath a see to resolve is to have an array of triangles, sqares, circles, etc..
an then add the aux to that array, and then push that adress to the Shapes vector, so it's redundant and usless to have the abstract class.


That won't change anything, the problem will be the same.

Sorry, I misread your explanation. Anyway that is not the best way to do that. It is much better to manage yourself the lifetime of your object using new/delete in that case.


-- modified at 10:42 Tuesday 2nd October, 2007


Cédric Moonen
Software developer

Charting control [v1.2]

GeneralRe: Using Abstract classes Pin
Apstolo2-Oct-07 5:47
Apstolo2-Oct-07 5:47 
QuestionDebug break on 64 bit Vista in VC6 hangs debugged app Pin
Paul Vickery2-Oct-07 3:01
professionalPaul Vickery2-Oct-07 3:01 
QuestionMFC property sheet, change tab event Pin
Caliban61001-Oct-07 23:41
Caliban61001-Oct-07 23:41 
AnswerRe: MFC property sheet, change tab event Pin
Nishad S2-Oct-07 0:47
Nishad S2-Oct-07 0:47 
QuestionBoost Test question urgent Pin
monsieur_jj1-Oct-07 22:25
monsieur_jj1-Oct-07 22:25 
QuestionWhat is theUse Of Abstract class Pin
tasumisra1-Oct-07 22:06
tasumisra1-Oct-07 22:06 
AnswerRe: What is theUse Of Abstract class Pin
Cedric Moonen1-Oct-07 22:38
Cedric Moonen1-Oct-07 22:38 
AnswerRe: What is theUse Of Abstract class Pin
Nemanja Trifunovic2-Oct-07 3:49
Nemanja Trifunovic2-Oct-07 3:49 
AnswerRe: What is theUse Of Abstract class Pin
Leslie Sanford2-Oct-07 6:35
Leslie Sanford2-Oct-07 6:35 
Questionthemes & controls Pin
mitok1-Oct-07 21:54
mitok1-Oct-07 21:54 
QuestionFunction Pointer error Pin
Mustafa Ismail Mustafa1-Oct-07 20:59
Mustafa Ismail Mustafa1-Oct-07 20:59 
AnswerRe: Function Pointer error Pin
Cedric Moonen1-Oct-07 21:09
Cedric Moonen1-Oct-07 21:09 
GeneralRe: Function Pointer error Pin
Mustafa Ismail Mustafa1-Oct-07 21:20
Mustafa Ismail Mustafa1-Oct-07 21:20 
GeneralRe: Function Pointer error Pin
Cedric Moonen1-Oct-07 21:26
Cedric Moonen1-Oct-07 21:26 
GeneralRe: Function Pointer error Pin
Mustafa Ismail Mustafa1-Oct-07 21:21
Mustafa Ismail Mustafa1-Oct-07 21:21 
GeneralRe: Function Pointer error Pin
Cedric Moonen1-Oct-07 21:28
Cedric Moonen1-Oct-07 21:28 
GeneralRe: Function Pointer error Pin
Mustafa Ismail Mustafa1-Oct-07 21:38
Mustafa Ismail Mustafa1-Oct-07 21:38 

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.