Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

GetDlgItem IDC_PAINT error

I'm trying to retrieve a handle to the window to
update it with the following call in the callback
procedure for my dialog box :

case WM_INITDIALOG:
hCtrlBlock = GetDlgItem (hDlg, IDC_PAINT) ;

But get the following error :

error C2065: 'IDC_PAINT' : undeclared identifier

I thought IDC_PAINT is a part of the API. Would
anyone know what I'm doing wrong?

Comments

  • Johnny13Johnny13 Posts: 128Member
    : error C2065: 'IDC_PAINT' : undeclared identifier
    :
    : I thought IDC_PAINT is a part of the API. Would
    : anyone know what I'm doing wrong?
    [purple]The [b]GetDlgItem[/b] function retrieves the handle of a control in the specified dialog box.
    Which control of your dialogbox (in the resource section) defined as IDC_PAINT?[/purple][code]#define IDC_PAINT ???[/code]
  • j2000j2000 Posts: 11Member
    : : error C2065: 'IDC_PAINT' : undeclared identifier
    : :
    : : I thought IDC_PAINT is a part of the API. Would
    : : anyone know what I'm doing wrong?
    : [purple]The [b]GetDlgItem[/b] function retrieves the handle of a control in the specified dialog box.
    : Which control of your dialogbox (in the resource section) defined as IDC_PAINT?[/purple][code]#define IDC_PAINT ???[/code]
    :

    Okay, I see. Would you know what function I can call to retrieve
    the handle to the overall window?



  • HEPHEP Posts: 113Member
    Add this line after the other #include statements:

    #include "resource.h"
  • AsmGuru62AsmGuru62 Posts: 6,519Member
    : : : error C2065: 'IDC_PAINT' : undeclared identifier
    : : :
    : : : I thought IDC_PAINT is a part of the API. Would
    : : : anyone know what I'm doing wrong?
    : : [purple]The [b]GetDlgItem[/b] function retrieves the handle of a control in the specified dialog box.
    : : Which control of your dialogbox (in the resource section) defined as IDC_PAINT?[/purple][code]#define IDC_PAINT ???[/code]
    : :
    :
    : Okay, I see. Would you know what function I can call to retrieve
    : the handle to the overall window?
    :
    :
    [blue]I suspect you are doing the wrong things... can you tell me what exactly is the purpose of getting the dialog item? If you want to draw on it - this is completely diferent and you do not need this function at all - you need to reply to WM_RAWITEM message.[/blue]
Sign In or Register to comment.