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

C / C++ / MFC

 
AnswerRe: Listview controls Pin
Sebastian Pipping22-Feb-06 15:30
Sebastian Pipping22-Feb-06 15:30 
GeneralRe: Listview controls Pin
Waldermort23-Feb-06 1:09
Waldermort23-Feb-06 1:09 
QuestionCComboBox dropdown bit is hidden Pin
rw10422-Feb-06 4:18
rw10422-Feb-06 4:18 
AnswerRe: CComboBox dropdown bit is hidden Pin
Iain Clarke, Warrior Programmer22-Feb-06 4:52
Iain Clarke, Warrior Programmer22-Feb-06 4:52 
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 
ok, I kinda know the answer, but maybe I overlooked something.

I have a C linked list collection ( old legacy C code that I don't want to change ).
The new items are added at the beginning of the list.

If I want to pass this pointer around to different classes :

class MainClass
{
  MyList* pList;
};

class MyOtherClass
{
  MyList* pList;
};
....

/// add items in the pList of the MainClass
MainClass mainClass;
...
/// create MyOtherClass;
MyOtherClass otherClass;
otherClass.pList = mainClass.List;


now, if I add items to the list in MainClass, the other pointer in MyOtherClass will not point to the good item; it will point to the item that MainClass.pList was pointing at the time it was assigned.

is there an easy way to have the pointer pList in MyOtherClass always point to the same thing that the pointer pList in MainClass ?

One way to fix this would be to insert at the end; that will keep the head of the MainClass list.

One other way could be do something like : ( this seems to work in the small test I did )

class MyOtherClass
{
  MyList** pList;
};

///...
MyOtherClass.pList = &mainClass.pList;


but I can't do it in my application; the list belongs to a another class, and that implicate a lot of other problems.

Any other ideas ?

Thanks.



Maximilien Lincourt
Your Head A Splode - Strong Bad
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 
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 

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.