GetDlgItem IDC_PAINT error - Programmers Heaven

Howdy, Stranger!

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

Categories

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.