Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetDlgItem error

Status
Not open for further replies.

alexbo

Programmer
Jul 26, 2002
20
IT
Hi everybody,
I'm programming in MFC, I have the following problem.

I created in the resource editor a CCommandButton that has the following id IDC_CONF_PASS_ATH_DETT the dialog is in an ActiveX enviroment.

then i wrote the following code:

<code>
GetDlgItem(IDC_CONF_PASS_ATH_DETT)->ShowWindow(FALSE);
</code>

because the code dumped i wrote even another version

<code>
CCommandButton *b;
b=(CCommandButton *)GetDlgItem(IDC_CONF_PASS_ATH_DETT);
b->ShowWindow(TRUE);
</code>

and discovered in Debug that b has a NULL value and that's why it dumped.
but why b has a NULL value

Any Idea thanks Alex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top