Click here to Skip to main content
15,899,825 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionempty CPropertyPage + manifest = incorrect background Pin
AnthonyJ16-Nov-06 4:37
AnthonyJ16-Nov-06 4:37 
QuestionGDI+ Pin
Waldermort16-Nov-06 4:12
Waldermort16-Nov-06 4:12 
AnswerRe: GDI+ Pin
Mark Salsbery16-Nov-06 4:34
Mark Salsbery16-Nov-06 4:34 
GeneralRe: GDI+ Pin
Waldermort16-Nov-06 4:49
Waldermort16-Nov-06 4:49 
AnswerRe: GDI+ Pin
Mark Salsbery16-Nov-06 4:36
Mark Salsbery16-Nov-06 4:36 
QuestionCatching click event in the webbrowser document Pin
rrrado16-Nov-06 4:00
rrrado16-Nov-06 4:00 
AnswerRe: Catching click event in the webbrowser document Pin
led mike16-Nov-06 5:12
led mike16-Nov-06 5:12 
QuestionOdd MFC Property Page Data Loss Pin
switang16-Nov-06 3:56
switang16-Nov-06 3:56 
I have a Property Sheet that has three pages. One of the pages contains some edit controls. I have all the data exchange functions set up, blah, blah, blah...and the sheet works great, all data gets exchanged and I can view the changes in the data before I delete the property sheet.

OK. Here's where the problem occurs.

I open a dialog box via AfxMessageBox() to warn the user of a failure before the property sheet and pages are deleted. Immediately after (line after the call to AfxMessageBox()) the dialog is closed the values in the edit controls are reverted back to the values when the property page was first opened. If I comment out the call to the messaged box, the data remains changed.

I've stepped through most of the guts of AfxMessageBox() to find exactly when the data is reverted. Didn't really notice any changes in the data until after I click OK on the message box.

Synopsis:
- Open property sheet
- change data on a page
- click OK
- Data is changed
- Open message box to warn user
- click OK on message box
- Data is reverted

No DDX functions seemed to be called during the call to AfxMessageBox().

Code:
---------------------------------------------------------------------------------
...
//Change the printer values
if (returnValue == IDOK) {
**Data is CHANGED/UPDATED/STORED at this point**
if (generalProperties != NULL) {
//Printer Name
printer->name->replace(0, MAX_STRING, generalProperties->name);

...
}

if (printerControlProperties != NULL) {
//Assuming printer control properties was not open for
// printers that don't have controls

//Open the communication source
PrinterControl * printerControl =
printer->getPrinterControl();
_ASSERT(printerControl != NULL);

//Check for failure
if (!printerControl->openCommunicationSource((char *)
printerControlProperties->connection.GetString())) {
-----> AfxMessageBox(
"Unable to open connection to printer control.",
MB_OK | MB_APPLMODAL | MB_ICONEXCLAMATION, 0);
**Data is REVERTED at this point**
}
}
...
---------------------------------------------------------------------------------
End - Code
onfused:Confused | :confused: Confused | :confused: Confused | :confused:
GeneralRe: Odd MFC Property Page Data Loss [modified] Pin
switang16-Nov-06 4:17
switang16-Nov-06 4:17 
AnswerRe: Odd MFC Property Page Data Loss Pin
Mark Salsbery16-Nov-06 4:42
Mark Salsbery16-Nov-06 4:42 
GeneralRe: Odd MFC Property Page Data Loss Pin
switang16-Nov-06 4:51
switang16-Nov-06 4:51 
GeneralRe: Odd MFC Property Page Data Loss Pin
Mark Salsbery16-Nov-06 6:24
Mark Salsbery16-Nov-06 6:24 
GeneralRe: Odd MFC Property Page Data Loss Pin
switang16-Nov-06 6:45
switang16-Nov-06 6:45 
QuestionRe: Odd MFC Property Page Data Loss Pin
switang16-Nov-06 11:04
switang16-Nov-06 11:04 
AnswerRe: Odd MFC Property Page Data Loss Pin
Mark Salsbery16-Nov-06 11:21
Mark Salsbery16-Nov-06 11:21 
AnswerRe: Odd MFC Property Page Data Loss Pin
switang17-Nov-06 3:30
switang17-Nov-06 3:30 
GeneralRe: Odd MFC Property Page Data Loss [modified] Pin
switang16-Nov-06 5:10
switang16-Nov-06 5:10 
QuestionReplacement of CComModule and its working Pin
tom groezer16-Nov-06 1:43
tom groezer16-Nov-06 1:43 
QuestionSetting read properites of a file Pin
koumodaki16-Nov-06 1:41
koumodaki16-Nov-06 1:41 
GeneralRe: Setting read properites of a file Pin
prasad_som16-Nov-06 2:57
prasad_som16-Nov-06 2:57 
QuestionRe: Setting read properites of a file Pin
David Crow16-Nov-06 2:59
David Crow16-Nov-06 2:59 
AnswerRe: Setting read properites of a file [modified] Pin
koumodaki16-Nov-06 3:19
koumodaki16-Nov-06 3:19 
QuestionMFC Listview Pin
DanB198316-Nov-06 1:34
DanB198316-Nov-06 1:34 
AnswerRe: MFC Listview Pin
prasad_som16-Nov-06 1:55
prasad_som16-Nov-06 1:55 
GeneralRe: MFC Listview Pin
DanB198316-Nov-06 2:19
DanB198316-Nov-06 2:19 

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.