Click here to Skip to main content
15,895,256 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LGPL query Pin
Chintoo72322-Feb-06 15:21
Chintoo72322-Feb-06 15:21 
GeneralRe: LGPL query Pin
Chris Losinger22-Feb-06 16:01
professionalChris Losinger22-Feb-06 16:01 
AnswerRe: LGPL query Pin
Joe Woodbury22-Feb-06 8:26
professionalJoe Woodbury22-Feb-06 8:26 
AnswerRe: LGPL query Pin
Sebastian Pipping22-Feb-06 15:40
Sebastian Pipping22-Feb-06 15:40 
QuestionPassing Arrays of structures from VB.NET to unmanaged C++ Pin
CPop22-Feb-06 5:45
CPop22-Feb-06 5:45 
QuestionListview controls Pin
Waldermort22-Feb-06 5:23
Waldermort22-Feb-06 5:23 
AnswerRe: Listview controls Pin
Joe Woodbury22-Feb-06 5:41
professionalJoe Woodbury22-Feb-06 5:41 
AnswerRe: Listview controls Pin
Gavin Taylor22-Feb-06 6:07
professionalGavin Taylor22-Feb-06 6:07 
AnswerRe: Listview controls Pin
Sebastian Pipping22-Feb-06 10:32
Sebastian Pipping22-Feb-06 10:32 
GeneralRe: Listview controls Pin
Waldermort22-Feb-06 15:13
Waldermort22-Feb-06 15:13 
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 

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.