Re: let menu item mapped into non_based class ?
I map the menu item into my_view and call the function of my modeless
dialog as below:
void CMyView::Onfunction_view()
{
CMyModelessdialog::function_dialog();
}
the definintion is as below :
// CMyModelessdialog.h : header file
class CMyModelessdialog : public CDialog
{
// Construction
public:
static void function_dialog();
// Dialog Data
//{{AFX_DATA(CXIANGYINGQUXIAN)
enum { IDD = IDD_MyModelessdialog };
CListCtrl m_MyModelessdialog_list;
//}}AFX_DATA
void CMyModelessdialog::function_dialog();
{
CRect rect;
m_MyModelessdialog_list.GetClientRect(&rect);
int nColInterval = rect.Width()/5;
m_MyModelessdialog_list.InsertColumn(0, _T("Item Name"),
LVCFMT_LEFT, nColInterval*3);
}
but now ,it have a wrong , said that m_MyModelessdialog_list is not a
class ???
and I can not understand you meaning :
That function can manipulate the control Handle the menu item message in the parent of the dialog (such as the view)
the function is declared in dialog ,how can it be used in the view and
get the handle (do you meaans add the function in the message_loop )?
and call the new dialog function from the handler.
could you write a simple example ? thank you !