MinnisotaFreezing
Programmer
Good Morning,
Here is my latest dilemma. I'm trying to print information from edit controls that are on a dialog box. I'm using MFC, and the dialog box is called from the main view, which is CFormView derived. I sent a message from the dialog to the View telling the view to print. In the OnPrint function I put the following code:
CEdit * pEdit1 = (CEdit *) GetDlgItem(IDC_NEWEDIT);
pEdit1->GetWindowText(string);
where IDC_NEWEDIT is the name of the edit control on the dialog box. Sadly, pEdit1 returns as NULL.
I thought then I could try
HWND hwndDialog = (HWND)GetDlgItem(IDD_PRINT_DIALOG);
GetDlgItem(IDC_NEWEDIT, &hwndDialog);
Where hwndDialog was a handle to the window that contained the editbox, but hwndDialog returned null as well.
Basically, I'm trying to pull information from a child window control to a CFormView derivitive. Anyone have any suggestions? The dialog box is active, has control, then sends a message to the view, which needs to pull information to it from the dialog box.
My other idea was rather than make the dialog box a dialog box, I could make it another CFormView subclass, but I could not figure out how to call that form from my main form.
Thanks for your help,
CJB
Here is my latest dilemma. I'm trying to print information from edit controls that are on a dialog box. I'm using MFC, and the dialog box is called from the main view, which is CFormView derived. I sent a message from the dialog to the View telling the view to print. In the OnPrint function I put the following code:
CEdit * pEdit1 = (CEdit *) GetDlgItem(IDC_NEWEDIT);
pEdit1->GetWindowText(string);
where IDC_NEWEDIT is the name of the edit control on the dialog box. Sadly, pEdit1 returns as NULL.
I thought then I could try
HWND hwndDialog = (HWND)GetDlgItem(IDD_PRINT_DIALOG);
GetDlgItem(IDC_NEWEDIT, &hwndDialog);
Where hwndDialog was a handle to the window that contained the editbox, but hwndDialog returned null as well.
Basically, I'm trying to pull information from a child window control to a CFormView derivitive. Anyone have any suggestions? The dialog box is active, has control, then sends a message to the view, which needs to pull information to it from the dialog box.
My other idea was rather than make the dialog box a dialog box, I could make it another CFormView subclass, but I could not figure out how to call that form from my main form.
Thanks for your help,
CJB