Click here to Skip to main content
15,917,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LoadImage returns handle instead of NULL Pin
Alexander M.,10-Dec-03 5:18
Alexander M.,10-Dec-03 5:18 
GeneralRe: LoadImage returns handle instead of NULL Pin
David Crow10-Dec-03 8:06
David Crow10-Dec-03 8:06 
GeneralRe: LoadImage returns handle instead of NULL Pin
Tim Smith10-Dec-03 16:08
Tim Smith10-Dec-03 16:08 
GeneralRe: LoadImage returns handle instead of NULL Pin
mexicanchili11-Dec-03 3:24
mexicanchili11-Dec-03 3:24 
QuestionShould I be using struct instead? Pin
b_girl10-Dec-03 3:23
b_girl10-Dec-03 3:23 
AnswerRe: Should I be using struct instead? Pin
Antti Keskinen10-Dec-03 3:39
Antti Keskinen10-Dec-03 3:39 
GeneralRe: Should I be using struct instead? Pin
b_girl10-Dec-03 4:25
b_girl10-Dec-03 4:25 
GeneralRe: Should I be using struct instead? Pin
Antti Keskinen10-Dec-03 7:43
Antti Keskinen10-Dec-03 7:43 
After reading your answer to the other poster, I got a fairly good idea what you are doing.

I assume that you have this one program (thread) running, which is responsible for creating the dialog boxes. This thread has the CMainFrame class, which is the parent of the dialogs. If this is the case, the most efficient way is, like you first theorized, to create one new class: CDialogData.

This class would contain one or more CString members and if necessary, an ID variable of type UINT or similar. Then, you declare an array of pointers (5 sects) as a member variable of the parent class. As each dialog can access the parent class's members via cast-operators and GetParent, each dialog can create a new object of CDialogData on the heap and save it's address to the array of pointers.

This method would require minimalistic changes to the code itself: only the CDialogData declaration and the necessary modifications to the OnOK methods in question to create an object of CDialogData instead of saving to a file. At the end of program execution, the CMainFrame could go through the list of pointers and attempt a save of the member variables into a file if the pointer is valid (non-NULL).

I first thought that the dialog boxes are seperate programs running on seperate threads, in which case you would require inter-process communication or the file-saving technique.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
AnswerRe: Should I be using struct instead? Pin
Navin10-Dec-03 4:49
Navin10-Dec-03 4:49 
GeneralRe: Should I be using struct instead? Pin
b_girl10-Dec-03 5:04
b_girl10-Dec-03 5:04 
GeneralRe: Should I be using struct instead? Pin
Big Art10-Dec-03 6:02
Big Art10-Dec-03 6:02 
GeneralRe: Should I be using struct instead? Pin
b_girl10-Dec-03 6:10
b_girl10-Dec-03 6:10 
QuestionHow to interpret Call stack window message ? Pin
Deepak Samuel10-Dec-03 2:35
Deepak Samuel10-Dec-03 2:35 
AnswerRe: How to interpret Call stack window message ? Pin
Mike Dimmick10-Dec-03 2:41
Mike Dimmick10-Dec-03 2:41 
GeneralDLL Dialog Pin
macmac3810-Dec-03 2:18
macmac3810-Dec-03 2:18 
GeneralRe: DLL Dialog Pin
Antti Keskinen10-Dec-03 3:04
Antti Keskinen10-Dec-03 3:04 
GeneralRe: DLL Dialog Pin
macmac3810-Dec-03 4:46
macmac3810-Dec-03 4:46 
GeneralSearching in a DC Pin
Tommy2k10-Dec-03 2:05
Tommy2k10-Dec-03 2:05 
GeneralRe: Searching in a DC Pin
Antti Keskinen10-Dec-03 3:09
Antti Keskinen10-Dec-03 3:09 
QuestionHow to transparentize a window under Win9x? Pin
dot9910-Dec-03 1:31
dot9910-Dec-03 1:31 
AnswerRe: How to transparentize a window under Win9x? Pin
Antti Keskinen10-Dec-03 3:23
Antti Keskinen10-Dec-03 3:23 
GeneralRe: How to transparentize a window under Win9x? Pin
dot9910-Dec-03 3:53
dot9910-Dec-03 3:53 
GeneralRe: How to transparentize a window under Win9x? Pin
Antti Keskinen10-Dec-03 8:02
Antti Keskinen10-Dec-03 8:02 
GeneralRe: How to transparentize a window under Win9x? Pin
dot9910-Dec-03 12:09
dot9910-Dec-03 12:09 
AnswerRe: How to transparentize a window under Win9x? Pin
Member 36996310-Dec-03 12:17
Member 36996310-Dec-03 12:17 

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.