Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

SetDlgItemText issue

taherktaherk Member Posts: 5
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

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : 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
    :
    [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]
  • AndileinAndilein Member Posts: 1
    : 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?

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    [b][red]This message was edited by AsmGuru62 at 2002-10-31 8:9:50[/red][/b][hr]
    : : 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]


  • Andre YoungAndre Young USAMember Posts: 0

    _________ ( http://forcoder.org ) free video tutorials and ebooks about ( Assembly C PHP Delphi Objective-C Go Visual Basic C++ PL/SQL MATLAB Ruby R Perl Scratch JavaScript Visual Basic .NET Swift Java C# Python Awk FoxPro Crystal VBScript SAS COBOL Erlang F# Lua Alice Transact-SQL Fortran Prolog Rust ML Logo Hack Kotlin Clojure D Dart Apex Lisp Scheme ABAP Julia LabVIEW Ada Bash Scala ) ________

Sign In or Register to comment.