Resource ID doesn't associate with control 
Author Message
 Resource ID doesn't associate with control

Quote:

>Hello,

>I created a spin control.  I also added an OnDataChange function handler
>for the edit control that associated with the spin control.  This function
>gets the text from the edit control.

>The problem is the first time I turn the PC on, and run the program, the
>resource ID of the edit box is not associated with the control yet.
>Therefore, when I try to initialize the edit box in the OnInitDialog
>function, the OnDataChange function gets called and tried to get the text
>from the control, I get GPF.  (GetDlgItem(IDC_EDIT) returns NULL).  When I
>try to run the program again, it's was OK.  So the problem only happens
>when I first turn on the PC.  Can you help me understand why this is
>happening, and how to solve this?  Thank you very much.  I'm using VC++ 4.2
>and Windows95.

Did you call the dialog's superclass (CDialog) version of OnInitDialog()
first?  That is a requirement.

--------------------------------------------------------------------------------


XIOtech Corporation               Personal Home Page:   http://www.*-*-*.com/ ~nde
612-828-5961

"Question authority...and the authorities will end up questioning YOU!"
--------------------------------------------------------------------------------



Fri, 02 Jul 1999 03:00:00 GMT  
 Resource ID doesn't associate with control

Hello,

I created a spin control.  I also added an OnDataChange function handler
for the edit control that associated with the spin control.  This function
gets the text from the edit control.

The problem is the first time I turn the PC on, and run the program, the
resource ID of the edit box is not associated with the control yet.
Therefore, when I try to initialize the edit box in the OnInitDialog
function, the OnDataChange function gets called and tried to get the text
from the control, I get GPF.  (GetDlgItem(IDC_EDIT) returns NULL).  When I
try to run the program again, it's was OK.  So the problem only happens
when I first turn on the PC.  Can you help me understand why this is
happening, and how to solve this?  Thank you very much.  I'm using VC++ 4.2
and Windows95.

Duy Nguyen



Fri, 02 Jul 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting file associated with resource ID?

2. Windowless control (ATL) doesn't work correctly on VC++ dialog resource

3. Associating a derived class with a list control resource

4. Resource ID's.

5. Problems with Resource ID's

6. Class wizard loses resource id's!

7. Resource ID's

8. Hidden Resources ID's / Default Toolbar / View Status Indicator

9. Resource ID's

10. Resource-ID's

11. GetEditCtrl(), but what's the resource ID?

12. Resource ID's

 

 
Powered by phpBB® Forum Software