Hello,
I need help with the following:
I have made a MFC dialog based application.
On click of a button I am calling a function (Clear)which calls the following
SetDlgItemText (hwnd, EF_JOB, "");
This function (Clear)is defined in seperate cpp file. the header file of which i am including in the dlg.cpp file
The problem is that the above function just doesnt seem to work
Can anyone please help
Thanks
Taher
Comments
:
: I need help with the following:
:
: I have made a MFC dialog based application.
: On click of a button I am calling a function (Clear)which calls the following
:
: SetDlgItemText (hwnd, EF_JOB, "");
:
: This function (Clear)is defined in seperate cpp file. the header file of which i am including in the dlg.cpp file
:
: The problem is that the above function just doesnt seem to work
:
: Can anyone please help
:
: Thanks
: Taher
:
[blue]You should check if window identified by [b]hwnd[/b] has a control with ID=[b]EF_JOB[/b]. You can do it with:
HWND hControl = ::GetDlgItem (hwnd, EF_JOB);
put it just before your [b]SetDlgItemText()[/b] and check the [b]hControl[/b]. If its value is zero - then check your resources or where [b]hwnd[/b] is coming from.[/blue]
:
: I need help with the following:
:
: I have made a MFC dialog based application.
: On click of a button I am calling a function (Clear)which calls the following
:
: SetDlgItemText (hwnd, EF_JOB, "");
:
: This function (Clear)is defined in seperate cpp file. the header file of which i am including in the dlg.cpp file
:
: The problem is that the above function just doesnt seem to work
:
: Can anyone please help
:
: Thanks
: Taher
:
I guess u already call UpdateWindow() for your Dialog, do you?
: : Hello,
: :
: : I need help with the following:
: :
: : I have made a MFC dialog based application.
: : On click of a button I am calling a function (Clear)which calls the following
: :
: : SetDlgItemText (hwnd, EF_JOB, "");
: :
: : This function (Clear)is defined in seperate cpp file. the header file of which i am including in the dlg.cpp file
: :
: : The problem is that the above function just doesnt seem to work
: :
: : Can anyone please help
: :
: : Thanks
: : Taher
: :
:
: I guess u already call UpdateWindow() for your Dialog, do you?
:
:
[blue][b]SetDlgItemText()[/b] usually invalidates the control by itself. You need [b]UpdateWindow()[/b] if you use it in a loop without getting back to Windows.[/blue]