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

C / C++ / MFC

 
Questionhelp with win32 Pin
worldwarIIfanatic29-Apr-08 10:44
worldwarIIfanatic29-Apr-08 10:44 
AnswerRe: help with win32 Pin
Saurabh.Garg29-Apr-08 16:12
Saurabh.Garg29-Apr-08 16:12 
AnswerRe: help with win32 Pin
CPallini29-Apr-08 21:24
mveCPallini29-Apr-08 21:24 
AnswerRe: help with win32 Pin
Hamid_RT29-Apr-08 21:52
Hamid_RT29-Apr-08 21:52 
QuestionRe: help with win32 [modified] Pin
worldwarIIfanatic30-Apr-08 13:37
worldwarIIfanatic30-Apr-08 13:37 
QuestionRe: help with win32 Pin
worldwarIIfanatic5-May-08 13:34
worldwarIIfanatic5-May-08 13:34 
AnswerRe: help with win32 Pin
ninjanear22-May-08 7:57
professionalninjanear22-May-08 7:57 
QuestionCreating a linked list; need to know good practices. Pin
x87Bliss29-Apr-08 10:38
x87Bliss29-Apr-08 10:38 
I'm creating a linked list that stores two strings in each node.
I quickly drafted the code as:
<br />
struct SongInfo {<br />
    CString Title;<br />
    CString Address;<br />
    SongInfo* next;<br />
};<br />
<br />
void CreateList() { // not an actual function, just to illustrate my allocation<br />
    ...<br />
    if (bINeedAnother) {<br />
        cur->next = new SongInfo;<br />
        cur = cur->next;<br />
    }<br />
    ...<br />
}<br />


I am using CStrings since the length of the strings is unknown. However, since once they are initialized they don't change, I am thinking I should change it to dynamically allocated WCHAR pointers, with the appropriate length for each string. Or is there another practice that would be better?

The other question is on the allocation of the nodes. The number of nodes can be as few as 10, and I've seen as much as 300. Is it a bad idea to allocate one node at a time (i.e. can I rely on Windows to keep the memory unfragmented)? If so, what is a good practice here?

(Sorry for the noobish questions, my programming professor sucked, and her linked lists ALWAYS crashed, and she ALWAYS blamed the OS.)
AnswerRe: Creating a linked list; need to know good practices. Pin
Maximilien29-Apr-08 11:16
Maximilien29-Apr-08 11:16 
GeneralRe: Creating a linked list; need to know good practices. Pin
ninjanear21-May-08 3:15
professionalninjanear21-May-08 3:15 
QuestionHow to change keyboard typematic rate /delay (and led ind.) VC++/MFC? [modified] Pin
ninjanear29-Apr-08 10:05
professionalninjanear29-Apr-08 10:05 
QuestionRe: How to change typematic rate in keyboard? Pin
David Crow29-Apr-08 10:22
David Crow29-Apr-08 10:22 
AnswerRe: How to change typematic rate in keyboard? [modified] Pin
ninjanear20-May-08 23:07
professionalninjanear20-May-08 23:07 
QuestionHow do I customize the standard property sheet buttons Pin
si_6929-Apr-08 7:52
si_6929-Apr-08 7:52 
AnswerRe: How do I customize the standard property sheet buttons Pin
David Crow29-Apr-08 8:12
David Crow29-Apr-08 8:12 
AnswerRe: How do I customize the standard property sheet buttons Pin
Hamid_RT29-Apr-08 21:52
Hamid_RT29-Apr-08 21:52 
GeneralDynamically Creating Objects Pin
codeinelogic29-Apr-08 6:09
codeinelogic29-Apr-08 6:09 
QuestionRe: Dynamically Creating Objects Pin
David Crow29-Apr-08 7:29
David Crow29-Apr-08 7:29 
QuestionMFC dosen't care about code quality? Pin
Naveen29-Apr-08 4:16
Naveen29-Apr-08 4:16 
AnswerRe: MFC dosen't care about code quality? Pin
David Crow29-Apr-08 4:32
David Crow29-Apr-08 4:32 
GeneralRe: MFC dosen't care about code quality? Pin
Naveen29-Apr-08 4:44
Naveen29-Apr-08 4:44 
AnswerRe: MFC dosen't care about code quality? Pin
toxcct29-Apr-08 5:08
toxcct29-Apr-08 5:08 
GeneralRe: MFC dosen't care about code quality? Pin
Naveen29-Apr-08 5:23
Naveen29-Apr-08 5:23 
GeneralRe: MFC dosen't care about code quality? Pin
toxcct29-Apr-08 5:30
toxcct29-Apr-08 5:30 
AnswerRe: MFC dosen't care about code quality? PinPopular
Randor 29-Apr-08 5:51
professional Randor 29-Apr-08 5:51 

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.