opkedu.blogg.se

Getwindowtext to setwindow text
Getwindowtext to setwindow text












getwindowtext to setwindow text

I would also verify that 'GetDlgItem(hTab, IDC_EDIT2)' always returns a valid handle - you could try switching that to a different IDC_* value, for example, as a test. That would rule out the cbuf buffer being corrupted as causing the issue. It could well be that some other part of the code is overwriting memory used by something in the dialog handler.įor example, since the 'SetWindowText(GetDlgItem(hTab, IDC_EDIT2), cbuf) ' appears to cause the issue (either directly or indirectly), as a test, I would simplify that further by replacing "cbuf" with a hard-coded, static string, like "FOOBAR!". What I would do to track it down is comment out almost all the code in the dialog handler until the crash does NOT occur (i.e., simplify it until it works!), and then start adding code back in until it closes (crashes) again. I've seen Windows silently close dialog boxes and continue running the program if an exception occurs anywhere in the dialog handler's processing (e.g., when the stack gets corrupted, trashing the return address of the caller on the stack), and so the problem is likely elsewhere in the dialog handler's code. Post added at 20:27 - Previous post was at 19:51 -Īlso, while I'm on the topic of Scenario Editor dialogs, how do the IDC_BACK buttons get handled? The Deltaglider example includes no explicit handling of those buttons, yet they work.

getwindowtext to setwindow text

Has anyone else seen this behavior and solved it? I'm at a loss. I've double checked the properties on the dialog and on this control and the other controls all match this control I traced it down to this line by commenting everything else out and adding lines back in. What's really weird, is the other two calls to that method for other edit boxes don't exhibit this behavior. The section I've highlighted in red is the problem section.

getwindowtext to setwindow text

GetWindowText (GetDlgItem (hTab, IDC_EDIT2), cbuf, 256) GetWindowText (GetDlgItem (hTab, IDC_EDIT1), cbuf, 256) īool bTemp = SendDlgItemMessage(hTab, IDC_CHECK1, BM_GETCHECK, 0, 0) = BST_CHECKED Įlse if(id = IDC_SPIN2 || id = IDC_SPIN2A)














Getwindowtext to setwindow text