Click here to Skip to main content
15,902,447 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: To any Microsoft lurkers: MFC Enhancements? Pin
Joe Woodbury29-Sep-03 18:56
professionalJoe Woodbury29-Sep-03 18:56 
AnswerRe: To any Microsoft lurkers: MFC Enhancements? Pin
Anonymous29-Sep-03 21:15
Anonymous29-Sep-03 21:15 
GeneralRe: To any Microsoft lurkers: MFC Enhancements? Pin
Joe Woodbury30-Sep-03 4:50
professionalJoe Woodbury30-Sep-03 4:50 
AnswerRe: To any Microsoft lurkers: MFC Enhancements? Pin
jhwurmbach29-Sep-03 21:53
jhwurmbach29-Sep-03 21:53 
GeneralRe: To any Microsoft lurkers: MFC Enhancements? Pin
Joe Woodbury30-Sep-03 4:35
professionalJoe Woodbury30-Sep-03 4:35 
AnswerRe: To any Microsoft lurkers: MFC Enhancements? Pin
Neville Franks30-Sep-03 1:23
Neville Franks30-Sep-03 1:23 
GeneralRe: To any Microsoft lurkers: MFC Enhancements? Pin
Joe Woodbury30-Sep-03 4:47
professionalJoe Woodbury30-Sep-03 4:47 
GeneralLinked List Question Pin
Abin29-Sep-03 14:15
Abin29-Sep-03 14:15 
I'm thinking of how a linked list verifies whether a given node pointer points to a valid node in the list.

For example, suppose we have a linked list which chains up 10000 NODE, the user calls one member functions which takes a NODE* as parameter: InsertBefore(const NODE* pBefore, LPVOID lpData), now how does the linked list verify if pBefore points to a valid NODE which is contained in the list? I think basically there would be 2 possibilities:

Solution 1, Use ::IsValidReadPtr and ::IsValidWritePtr to check if the memory is available to current process and the consecutive memory block space are large enough to be read/written against a NODE object.

Solution 2, Travel through the whole list and exam pBefore with address of each NODE, stops whenever a match is found.

Personally I think solution 2 is definitely a no go because that would make the linked list ultimately slow if it contains a larget amount of nodes. Solution 1 is faster but not safe, because that way we cannot really make sure if pBefore really points to a NODE or not, it could be any object whose size is same or greater than a NODE and if we use some iterating method like while (pNode->pNext != NULL) {...;} we'll get our system hang...

So I really want to know how a linked list verify a NODE*, is there any better solution, thanks.
GeneralRe: Linked List Question Pin
Navin29-Sep-03 14:42
Navin29-Sep-03 14:42 
GeneralRe: Linked List Question Pin
Dave Bryant29-Sep-03 15:15
Dave Bryant29-Sep-03 15:15 
QuestionHow about ctoolbar! simple! Pin
twing29-Sep-03 14:04
twing29-Sep-03 14:04 
AnswerRe: How about ctoolbar! simple! Pin
twing29-Sep-03 20:36
twing29-Sep-03 20:36 
GeneralCTRL+C and CTRL+V doesn't work on combox, placed on DialogBar Pin
SandeepN29-Sep-03 13:09
SandeepN29-Sep-03 13:09 
GeneralProblem when executing this code Pin
29-Sep-03 12:33
suss29-Sep-03 12:33 
GeneralRe: Problem when executing this code Pin
Paul Belikian29-Sep-03 13:03
Paul Belikian29-Sep-03 13:03 
GeneralRe: Problem when executing this code Pin
Tim Smith29-Sep-03 13:17
Tim Smith29-Sep-03 13:17 
GeneralRe: Problem when executing this code Pin
JT Anderson29-Sep-03 13:19
JT Anderson29-Sep-03 13:19 
GeneralHow bout this Pin
shawnsch29-Sep-03 13:38
shawnsch29-Sep-03 13:38 
GeneralRe: How bout this Pin
ZoogieZork29-Sep-03 14:35
ZoogieZork29-Sep-03 14:35 
GeneralRe: How bout this Pin
shawnsch29-Sep-03 17:41
shawnsch29-Sep-03 17:41 
GeneralRe: How bout this Pin
ZoogieZork29-Sep-03 18:50
ZoogieZork29-Sep-03 18:50 
GeneralShould be easy... Pin
RobJones29-Sep-03 11:26
RobJones29-Sep-03 11:26 
GeneralRe: Should be easy... Pin
Dave Bryant29-Sep-03 11:33
Dave Bryant29-Sep-03 11:33 
GeneralRe: Should be easy... Pin
RobJones29-Sep-03 11:55
RobJones29-Sep-03 11:55 
GeneralGetModuleFileName instance and registering app Pin
Raymond So29-Sep-03 9:15
Raymond So29-Sep-03 9: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.