Handle to Dialog, In Dialog Application
-
Hi, I am designing a simple dialog application in VS.net. In the dialog class that is created, I call a class of my own, that is not derived from any MFC class. My class needs access to an Edit control in the main dialog. It looks as if my class needs a handle to the parent class, hlg, in this case the dialog window. QUESTION: How do I find the parent, main dialog, parent window?? I have been trying to find it while setting breakpoints in the debugger. Thanks. Jerry
-
Hi, I am designing a simple dialog application in VS.net. In the dialog class that is created, I call a class of my own, that is not derived from any MFC class. My class needs access to an Edit control in the main dialog. It looks as if my class needs a handle to the parent class, hlg, in this case the dialog window. QUESTION: How do I find the parent, main dialog, parent window?? I have been trying to find it while setting breakpoints in the debugger. Thanks. Jerry
jerry1211a wrote:
My class needs access to an Edit control in the main dialog.
This is not advisable. What is it exactly that you are trying to do?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
-
Hi, I am designing a simple dialog application in VS.net. In the dialog class that is created, I call a class of my own, that is not derived from any MFC class. My class needs access to an Edit control in the main dialog. It looks as if my class needs a handle to the parent class, hlg, in this case the dialog window. QUESTION: How do I find the parent, main dialog, parent window?? I have been trying to find it while setting breakpoints in the debugger. Thanks. Jerry
for access to main dialog you can use GetParent but you said "that is not derived from any MFC class"
-
Hi, I am designing a simple dialog application in VS.net. In the dialog class that is created, I call a class of my own, that is not derived from any MFC class. My class needs access to an Edit control in the main dialog. It looks as if my class needs a handle to the parent class, hlg, in this case the dialog window. QUESTION: How do I find the parent, main dialog, parent window?? I have been trying to find it while setting breakpoints in the debugger. Thanks. Jerry
In your own class create a member to your edit control (like CEdit* m_pEdit). Then create a function to set the member (like SetEdit(CEdit* pEdit) { m_pEdit = pEdit; } ). Then in your own class, use m_pEdit->SetWindowText(...) or GetWindowText(...). Does that work?
- S 50 cups of coffee and you know it's on!