in win32, how do i access an a dialog edit box from its dialog proc?

Started by
2 comments, last by anist 19 years, 6 months ago
As you see below, this is part of the dialog procedure of a dialog, obviously. I need the main source code to access IDC_MAINEDIT which is the name of the edit in the dialog. The idea is to set it blank, but right now its not recognizing with this error: error C2664: 'SetWindowTextA' : cannot convert parameter 1 from 'const int' to 'struct HWND__ *' Any idea on this?

					case IDR_FILENEW: 
						{
							if (MessageBox(NULL, "Are you sure you want to make a new document?", "New Document",
								MB_ICONQUESTION | MB_YESNO) == IDYES)
							{
									SetWindowText(IDC_MAINEDIT, "");
							}
						}
						break;

Advertisement
try this function.
As your leader, I encourage you from time to time, and always in a respectful manner, to question my logic. If you're unconvinced that a particular plan of action I've decided is the wisest, tell me so, but allow me to convince you and I promise you right here and now, no subject will ever be taboo. Except, of course, the subject that was just under discussion. The price you pay for bringing up either my Chinese or American heritage as a negative is - I collect your f***ing head.
Thanks, I forgot about that function. Works well :)
anytime you see a HWND vs int error, you can always count on the menu and dialog functions. just a rule of thumb with Win32.
As your leader, I encourage you from time to time, and always in a respectful manner, to question my logic. If you're unconvinced that a particular plan of action I've decided is the wisest, tell me so, but allow me to convince you and I promise you right here and now, no subject will ever be taboo. Except, of course, the subject that was just under discussion. The price you pay for bringing up either my Chinese or American heritage as a negative is - I collect your f***ing head.

This topic is closed to new replies.

Advertisement