Click here to Skip to main content
15,910,130 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Calling JavaScript functions from an ActiveX Pin
John R. Shaw7-Jan-04 13:45
John R. Shaw7-Jan-04 13:45 
GeneralRe: Calling JavaScript functions from an ActiveX Pin
obe7-Jan-04 19:19
obe7-Jan-04 19:19 
GeneralRe: Calling JavaScript functions from an ActiveX Pin
John R. Shaw8-Jan-04 4:16
John R. Shaw8-Jan-04 4:16 
GeneralMy silly build error... Pin
bitpusher7-Jan-04 12:33
bitpusher7-Jan-04 12:33 
GeneralRe: My silly build error... Pin
Wes Aday7-Jan-04 12:56
professionalWes Aday7-Jan-04 12:56 
GeneralRe: My silly build error... Pin
John R. Shaw7-Jan-04 13:06
John R. Shaw7-Jan-04 13:06 
GeneralRe: My silly build error... Pin
bitpusher7-Jan-04 13:26
bitpusher7-Jan-04 13:26 
GeneralBest way to display a configuration dialog Pin
shultas7-Jan-04 12:05
shultas7-Jan-04 12:05 
Hello all.

I am wondering if someone could give me a step in the right direction. I have created a simple dialog-based application. I have also created another dialog for the configuration screen. I can call this dialog just fine by declaring a variable of it and calling doModal() and it works great.

Now, what I am wondering is the best way to "share" the data between the two of them. For instance, this is what I was doing now (and it don't work!). I had created some protected variables on the CONFIG dialog. I've also created some methods such as isConfigured(). In my main dialoag, I was doing something of this nature:

ConfigureDialog myConfigDlg;
myConfigDlg.readConfiguration();
if ( myConfigDlg.isConfigured() ) {
...
}
etc...

Now that appears to work great except for one thing. I had put this into my OnInitDialog() method for the main dialog ... so when the main dialog starts, it reads the configuration and makes sure everything is OK.

I also need to access this configuration during button presses on the main dialog. So, what I did
is in my onBnClicked() method, I put another ConfigureDialog myConfigDlg; in there and straight-way checked one of the variables with its method, and it did not "save over the data". I have since realized that I've only created an instance of this dialog. (Somewhat new to OOP). So, when the program left the OnInitDialog method, it destroyed that instance so all that data that it read is long gone.

So, what I am wondering is what may be the best way for me to go ahead with a configuration routine? I kind of wanted to have one class, which was the configure class, that did all of the reading/writing/etc of the configuration file. But the question is, how can I instantiate that class one time in my main dialog (for instance during OnInitDialog() ) and then keep it "in scope" for that entire dialog to read?

Hope I explained that enough! Thanks in advance for the replies.

GeneralRe: Best way to display a configuration dialog - some more detail Pin
shultas7-Jan-04 12:11
shultas7-Jan-04 12:11 
GeneralRe: Best way to display a configuration dialog - some more detail Pin
John R. Shaw7-Jan-04 13:29
John R. Shaw7-Jan-04 13:29 
GeneralRe: Best way to display a configuration dialog Pin
Christian Graus7-Jan-04 12:25
protectorChristian Graus7-Jan-04 12:25 
GeneralExtended MAPI GUID declaration problem Pin
Adam Gritt7-Jan-04 10:55
Adam Gritt7-Jan-04 10:55 
GeneralRe: Extended MAPI GUID declaration problem Pin
nightcoder7-Jan-04 12:02
nightcoder7-Jan-04 12:02 
GeneralRe: Extended MAPI GUID declaration problem Pin
Adam Gritt7-Jan-04 12:10
Adam Gritt7-Jan-04 12:10 
GeneralRe: Extended MAPI GUID declaration problem Pin
Bo Hunter7-Jan-04 12:15
Bo Hunter7-Jan-04 12:15 
GeneralRe: Extended MAPI GUID declaration problem Pin
Adam Gritt7-Jan-04 12:22
Adam Gritt7-Jan-04 12:22 
QuestionHow to draw 2D Shapes with VC++ in DOS ? Pin
Eldalie7-Jan-04 10:32
Eldalie7-Jan-04 10:32 
AnswerRe: How to draw 2D Shapes with VC++ in DOS ? Pin
Jeremy Falcon7-Jan-04 11:34
professionalJeremy Falcon7-Jan-04 11:34 
GeneralRe: How to draw 2D Shapes with VC++ in DOS ? Pin
Eldalie8-Jan-04 8:00
Eldalie8-Jan-04 8:00 
GeneralWhat's up with Rich Edit control Pin
Anonymous7-Jan-04 9:20
Anonymous7-Jan-04 9:20 
GeneralRe: What's up with Rich Edit control Pin
David Crow7-Jan-04 9:46
David Crow7-Jan-04 9:46 
GeneralRe: What's up with Rich Edit control Pin
Anonymous7-Jan-04 9:51
Anonymous7-Jan-04 9:51 
GeneralA CxImage Problem (CXX0030: Error: expression can not be evaluated) Pin
ElizabethC7-Jan-04 8:51
ElizabethC7-Jan-04 8:51 
GeneralRe: A CxImage Problem (CXX0030: Error: expression can not be evaluated) Pin
Monty27-Jan-04 18:16
Monty27-Jan-04 18:16 
GeneralRe: A CxImage Problem (CXX0030: Error: expression can not be evaluated) Pin
ElizabethC8-Jan-04 5:55
ElizabethC8-Jan-04 5:55 

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.