传递主窗口句柄或者控件给其他cpp使用

来源:互联网 发布:淘宝客订单接口 编辑:程序博客网 时间:2024/05/21 17:31

void SetMainWnd(CWnd* pWnd);
void SetInfoList(CListBox* pInfoList);

CWnd* g_pMainWnd;
CListBox* g_pInfoList;

void SetMainWnd(CWnd* pWnd)
{
g_pMainWnd = pWnd;
}

void SetInfoList(CListBox* pInfoList)
{
g_pInfoList = pInfoList;
}

主窗口初始化调用:
::SetInfoList(&m_list);
::SetMainWnd(this);

阅读全文
0 0