Click here to Skip to main content
15,893,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CProgressCtrl Question Pin
David Crow28-Mar-05 2:51
David Crow28-Mar-05 2:51 
Questiontemplate bug in vc++6? Pin
nm_11427-Mar-05 7:21
nm_11427-Mar-05 7:21 
AnswerRe: template bug in vc++6? Pin
Joaquín M López Muñoz27-Mar-05 9:36
Joaquín M López Muñoz27-Mar-05 9:36 
GeneralRe: template bug in vc++6? Pin
nm_11427-Mar-05 13:30
nm_11427-Mar-05 13:30 
GeneralArray of Pointers Pin
LighthouseJ27-Mar-05 6:05
LighthouseJ27-Mar-05 6:05 
GeneralRe: Array of Pointers Pin
Gary R. Wheeler27-Mar-05 6:33
Gary R. Wheeler27-Mar-05 6:33 
GeneralRe: Array of Pointers Pin
LighthouseJ27-Mar-05 6:56
LighthouseJ27-Mar-05 6:56 
GeneralRe: Array of Pointers Pin
LighthouseJ27-Mar-05 11:40
LighthouseJ27-Mar-05 11:40 
I used your method (although a malloc line did the same thing) to create the array of pointers. After this code is run, I run the same class member function in each instance of the class. I get no compile errors, but I have a piece of code within a member of the class I am creating the array of pointers to. My program crashes when it runs my code after your statements. However, if I eliminate the loop and create each new class manually, the code doesn't crash. In both instances, the trace runs to the first class and finds the member function but an array in the member function crashes when using the first piece of code. The function executes fine with the second set of statements.

This doesn't work:
CClass **list = new CClass *[AmountOfPointers];<br />
for (idnum = 0; idnum < AmountOfPointers; idnum++) { list[idnum] = new CClass(idnum); }


However, this code does work:
CClass **list = new CClass *[AmountOfPointers];<br />
list[0] = new CClass(0);<br />
list[1] = new CClass(1);<br />
list[2] = new CClass(2);<br />
... etc ...


I don't get why it's crashing because of a difference between a loop and a set of manual statements.
GeneralRe: Array of Pointers Pin
Axter26-Apr-05 18:07
professionalAxter26-Apr-05 18:07 
GeneralFollow-Up Pin
LighthouseJ27-Mar-05 6:36
LighthouseJ27-Mar-05 6:36 
GeneralRe: Follow-Up Pin
Gary R. Wheeler27-Mar-05 7:01
Gary R. Wheeler27-Mar-05 7:01 
GeneralRe: Array of Pointers Pin
Michael Dunn27-Mar-05 10:41
sitebuilderMichael Dunn27-Mar-05 10:41 
GeneralAES algorithm implementation in VC++ Pin
Member 154898327-Mar-05 4:16
Member 154898327-Mar-05 4:16 
GeneralRe: AES algorithm implementation in VC++ Pin
Michael Dunn27-Mar-05 10:43
sitebuilderMichael Dunn27-Mar-05 10:43 
GeneralRe: AES algorithm implementation in VC++ Pin
Anonymous28-Mar-05 1:27
Anonymous28-Mar-05 1:27 
GeneralLaunching application at startup Pin
Imtiaz Murtaza27-Mar-05 3:33
Imtiaz Murtaza27-Mar-05 3:33 
GeneralRe: Launching application at startup Pin
Gary R. Wheeler27-Mar-05 3:42
Gary R. Wheeler27-Mar-05 3:42 
GeneralRe: Launching application at startup Pin
David Crow28-Mar-05 2:56
David Crow28-Mar-05 2:56 
General.net events from unmanaged code Pin
ischen_s127-Mar-05 2:34
ischen_s127-Mar-05 2:34 
GeneralDLL hook in an .exe Pin
DigitalPenetration27-Mar-05 2:10
DigitalPenetration27-Mar-05 2:10 
GeneralRe: DLL hook in an .exe Pin
ThatsAlok27-Mar-05 18:07
ThatsAlok27-Mar-05 18:07 
GeneralRe: DLL hook in an .exe Pin
DigitalPenetration28-Mar-05 7:47
DigitalPenetration28-Mar-05 7:47 
GeneralExport templates from DLL Pin
mistus27-Mar-05 1:57
mistus27-Mar-05 1:57 
GeneralRe: Export templates from DLL Pin
includeh1027-Mar-05 7:15
includeh1027-Mar-05 7:15 
GeneralRe: Export templates from DLL Pin
MMansonFan2529-Mar-05 23:05
MMansonFan2529-Mar-05 23:05 

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.