Click here to Skip to main content
15,887,409 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CComboBox dropdown bit is hidden Pin
rw10422-Feb-06 4:56
rw10422-Feb-06 4:56 
Questiondrawing problem Pin
Deviantizh22-Feb-06 4:06
Deviantizh22-Feb-06 4:06 
AnswerRe: drawing problem Pin
Cedric Moonen22-Feb-06 4:33
Cedric Moonen22-Feb-06 4:33 
QuestionDumb question of the week C pointer question. Pin
Maximilien22-Feb-06 3:27
Maximilien22-Feb-06 3:27 
AnswerRe: Dumb question of the week C pointer question. Pin
Cedric Moonen22-Feb-06 3:34
Cedric Moonen22-Feb-06 3:34 
GeneralRe: Dumb question of the week C pointer question. Pin
Sebastian Schneider22-Feb-06 4:19
Sebastian Schneider22-Feb-06 4:19 
GeneralRe: Dumb question of the week C pointer question. Pin
Maximilien22-Feb-06 4:40
Maximilien22-Feb-06 4:40 
AnswerRe: Dumb question of the week C pointer question. Pin
Sebastian Schneider22-Feb-06 4:13
Sebastian Schneider22-Feb-06 4:13 
If you invalidate the pointer in your main class, you will have to update it in the other class.

One other thing you could try: Have a function "getCurrentPointer" or whatever you want to call it, and store a MainClass* myMainClass in your "OtherClass". Then use "myMainClass->getCurrentPointer" to retrieve the actual object.

e.g. (c-like pseudocode):

class MainClass
{
private List myList
public List* getCurrentList()
}

class OtherClass
{
private MainClass* pMainClass
public void setMainClass(*MainClass)
}

and somewhere:
OtherClass myOtherClass
MainClass myMainClass
OtherClass.setMainClass(&myMainClass)

// Now, when you change your List, you always use
myOtherClass.pMainClass->getCurrentList()


Since you are not pointing to a data member of a MainClass object, but to the object itself, you can do about everything you want with the MainClass-List (except deleting it, of course) and still have a way to access the List from your other class.

Thats just an idea Smile | :)



Cheers,
Sebastian

--
Contra vim mortem non est medicamen in hortem.
GeneralRe: Dumb question of the week C pointer question. Pin
Maximilien22-Feb-06 4:45
Maximilien22-Feb-06 4:45 
QuestionApp Path - how to get it Pin
miqel22-Feb-06 3:16
miqel22-Feb-06 3:16 
AnswerRe: App Path - haw to get it Pin
krmed22-Feb-06 3:21
krmed22-Feb-06 3:21 
GeneralRe: App Path - haw to get it Pin
miqel22-Feb-06 3:45
miqel22-Feb-06 3:45 
AnswerRe: App Path - haw to get it Pin
James R. Twine22-Feb-06 3:59
James R. Twine22-Feb-06 3:59 
AnswerRe: App Path - how to get it Pin
David Crow22-Feb-06 7:00
David Crow22-Feb-06 7:00 
AnswerRe: App Path - how to get it Pin
James R. Twine22-Feb-06 7:25
James R. Twine22-Feb-06 7:25 
GeneralRe: App Path - how to get it Pin
David Crow22-Feb-06 7:34
David Crow22-Feb-06 7:34 
QuestionNamespace Extension icons Pin
Anil_vvs22-Feb-06 2:45
Anil_vvs22-Feb-06 2:45 
AnswerRe: Namespace Extension icons Pin
Alexander M.,22-Feb-06 3:24
Alexander M.,22-Feb-06 3:24 
GeneralRe: Namespace Extension icons Pin
Anil_vvs22-Feb-06 3:27
Anil_vvs22-Feb-06 3:27 
AnswerRe: Namespace Extension icons Pin
ThatsAlok22-Feb-06 22:49
ThatsAlok22-Feb-06 22:49 
QuestionProblem with SHFormatDrive () Pin
rajeevktripathi22-Feb-06 2:41
rajeevktripathi22-Feb-06 2:41 
AnswerRe: Problem with SHFormatDrive () Pin
toxcct22-Feb-06 2:50
toxcct22-Feb-06 2:50 
GeneralRe: Problem with SHFormatDrive () Pin
Sebastian Schneider22-Feb-06 4:16
Sebastian Schneider22-Feb-06 4:16 
GeneralRe: Problem with SHFormatDrive () Pin
Cedric Moonen22-Feb-06 4:34
Cedric Moonen22-Feb-06 4:34 
GeneralRe: Problem with SHFormatDrive () Pin
ThatsAlok22-Feb-06 22:43
ThatsAlok22-Feb-06 22:43 

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.