Click here to Skip to main content
15,905,323 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: XP GetSysColor()??? Pin
michael_cowan29-Oct-03 13:00
michael_cowan29-Oct-03 13:00 
GeneralRe: XP GetSysColor()??? Pin
alex.barylski29-Oct-03 15:17
alex.barylski29-Oct-03 15:17 
GeneralCalling a dialog from a dll question Pin
Steve Messer29-Oct-03 11:53
Steve Messer29-Oct-03 11:53 
GeneralRe: Calling a dialog from a dll question Pin
igor196029-Oct-03 12:49
igor196029-Oct-03 12:49 
GeneralRe: Calling a dialog from a dll question Pin
Steve Messer29-Oct-03 14:35
Steve Messer29-Oct-03 14:35 
GeneralProblem with control arrays Pin
Stephan Poirier29-Oct-03 11:49
Stephan Poirier29-Oct-03 11:49 
GeneralRe: Problem with control arrays Pin
alex.barylski29-Oct-03 12:04
alex.barylski29-Oct-03 12:04 
GeneralRe: Problem with control arrays Pin
Joaquín M López Muñoz29-Oct-03 12:05
Joaquín M López Muñoz29-Oct-03 12:05 
Most likely the problem lies in your use of realloc. Simply put, realloc won't work except if the types contained in the array are primitive (integer types, pointers, little more.) The reason is that realloc, when moving to a larger block of memory, copies the original contents as if with memcpy, and this is not guaranteed to work for types which provide their own copy constructors.

My suggestion is that you store pointers to CButton instead of CButton objects. This implies an extra allocation per button:
myButton[nIndex]=new CButton;
myButton[nIndex]->Create(...);
and don't forget to delete these objects when done.

Also, do yourself a favor and forget about realloc. C++ provides for instance std::vector which does the work in a far easier way.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Problem with control arrays Pin
Stephan Poirier29-Oct-03 12:43
Stephan Poirier29-Oct-03 12:43 
GeneralRe: Problem with control arrays Pin
Stephan Poirier29-Oct-03 13:01
Stephan Poirier29-Oct-03 13:01 
GeneralATL 7 collection class Pin
Urban Olars29-Oct-03 10:45
Urban Olars29-Oct-03 10:45 
QuestionCan someone clarify some Windows' terms for me Pin
mwhannan29-Oct-03 10:38
mwhannan29-Oct-03 10:38 
AnswerRe: Can someone clarify some Windows' terms for me Pin
alex.barylski29-Oct-03 11:07
alex.barylski29-Oct-03 11:07 
GeneralRe: Can someone clarify some Windows' terms for me Pin
Blake Coverett29-Oct-03 11:12
Blake Coverett29-Oct-03 11:12 
AnswerRe: Can someone clarify some Windows' terms for me Pin
Blake Coverett29-Oct-03 11:10
Blake Coverett29-Oct-03 11:10 
AnswerRe: Can someone clarify some Windows' terms for me Pin
mwhannan29-Oct-03 17:10
mwhannan29-Oct-03 17:10 
GeneralLooking for products for relational and code generation Pin
mcgahanfl29-Oct-03 10:35
mcgahanfl29-Oct-03 10:35 
GeneralHelp !!! Pin
Guillermo Rivero29-Oct-03 10:19
Guillermo Rivero29-Oct-03 10:19 
GeneralRe: Help !!! Pin
Christian Graus29-Oct-03 15:06
protectorChristian Graus29-Oct-03 15:06 
GeneralCMDIChildWnd Scrollbars Pin
alex.barylski29-Oct-03 9:50
alex.barylski29-Oct-03 9:50 
GeneralRe: CMDIChildWnd Scrollbars Pin
alex.barylski29-Oct-03 11:17
alex.barylski29-Oct-03 11:17 
GeneralRe: CMDIChildWnd Scrollbars Pin
Peter Molnar29-Oct-03 12:59
Peter Molnar29-Oct-03 12:59 
QuestionWhich one makes for faster programs: DLLs or static libraries??? Pin
mwhannan29-Oct-03 9:24
mwhannan29-Oct-03 9:24 
AnswerRe: Which one makes for faster programs: DLLs or static libraries??? Pin
winalice29-Oct-03 9:35
winalice29-Oct-03 9:35 
AnswerRe: Which one makes for faster programs: DLLs or static libraries??? Pin
alex.barylski29-Oct-03 9:58
alex.barylski29-Oct-03 9:58 

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.