Click here to Skip to main content
14,693,130 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a dialog in which i have created 2 controls programatically.

GetDlgItem either for the dialog or for the controls returns NULL and hence the exception.

Please guide how to correct this.

code:

GetDlgItem(ID_STATIC_MULTI)-> MoveWindow(5,5,width,length);

ID_STATIC_MULTI is found in foll places:
1) .rc
2) .h
3) .cpp
Posted
Updated 9-Feb-11 6:04am
v3
Comments
CPallini 9-Feb-11 9:49am
   
Code, Watson, we need actual code!
Nish Nishant 9-Feb-11 10:09am
   
Updated my answer...

1 solution

You are probably call GetDlgItem with the wrong control identifiers. Post some code so that can be verified.

Okay, based on your code, it seems you do have that identifier defined, but that does not mean you create your controls using that id. Show the code where you create the child controls.
   
v2
Comments
Sudhansangeetha 9-Feb-11 13:14pm
   
ID_STATIC_MULTI is the control created manually on the form.
Nish Nishant 9-Feb-11 14:59pm
   
Once again, you need to show your actual code. Else people will not be able to figure out what you are doing wrong.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900