求助,想在cdialog类中,点击button显示一个cformview类 我知道用Domodal()肯定不行,因为这个是cdialog类的cformview该怎么弄呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 为啥非得是cformview呢,对话框不行呀? 例如有个form叫做LoginForm,那么在LoginForm中写如下代码:CLoginForm* CLoginForm::CreateForm(CWnd* parent){ CRuntimeClass* pClass = RUNTIME_CLASS(CLoginForm); ASSERT(pClass); CWnd *pWindow = (CWnd *)pClass->CreateObject(); ASSERT(pWindow); pWindow->Create(NULL, NULL, WS_CHILD, CRect(0, 0, 0, 0), parent, 0); return (CLoginForm *)pWindow;}使用的时候这么弄:CLoginForm* m_pLoginForm;m_pLoginForm = CLoginForm::CreateForm(this);m_pLoginForm->ShowWindow(SW_SHOW); 'CPrintListCtrlTesterView::CreateForm' : illegal call of non-static member function这个是什么回事? 错误提示是说:编译时发现用调用静态成员函数的方法调用了非静态的成员函数学会看错误提示哦~忘记告诉你要这么定义了:static CLoginForm* CreateForm(CWnd* parent); 在你的类里应该是:static CPrintListCtrlTesterView* CreateForm(CWnd* parent); 对 根据提示 我debug了 没有错误 但是cformview出不来 Creating a pane with no CDocument 这个问题 能出来的,在你调用的窗体上,多试试,formview其实就是个没有边框的窗体这样试试:CPrintListCtrlTesterView frm;frm.Create(....);frm.ShowWindow(SW_SHOW); 关于VC内联汇编CALL代码问题 如何把编辑框中的数据显示在视图中 求助:VC如何直接操作ftp服务器的文件进行重命名处理 全国范围招聘兼职程序员 OCX里可以用PreTranslateMessage捕获系统的消息吗? ADO怎样得到表名 如何获取系统信息框的路径 请教高手:如何用CArray类来实现矩阵存储? 如何将下面c程序的代码转换成Visual C++里面的代码???? 请问哪位高手可以给我一个扁平滚动条的例子吗? 串口发送00 char转 VARIANT c/c++ windows 下系统详细设计文档 模块表示方法?
{
CRuntimeClass* pClass = RUNTIME_CLASS(CLoginForm);
ASSERT(pClass); CWnd *pWindow = (CWnd *)pClass->CreateObject();
ASSERT(pWindow); pWindow->Create(NULL, NULL, WS_CHILD, CRect(0, 0, 0, 0), parent, 0); return (CLoginForm *)pWindow;
}使用的时候这么弄:CLoginForm* m_pLoginForm;
m_pLoginForm = CLoginForm::CreateForm(this);
m_pLoginForm->ShowWindow(SW_SHOW);
这个是什么回事?
static CPrintListCtrlTesterView* CreateForm(CWnd* parent);
这样试试:
CPrintListCtrlTesterView frm;
frm.Create(....);
frm.ShowWindow(SW_SHOW);