菜单谈出对话框的问题?

luo00t 2008-11-02 08:01:21
This application has requested the Runtime to terminate it in an unusual way,Please contact the application's support team for more information.

运行时报错..谁帮我翻译一下
...全文
63 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
luo00t 2008-11-03
  • 打赏
  • 举报
回复
部分相关代码?请兄弟们好好看看..帮我看什么地方错鸟..
~~~~~~~~~~~~~~~~!!
HRMSDlg.cpp
void CHRMSDlg::OnFileRecord()
{
// TODO: Add your command handler code here
CFileRecord fileRecord;
fileRecord.DoModal();
}


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FileRecord.cpp
//初始化部门组合框
BOOL CFileRecord::InitDeptComboBox(CComboBox *pDept)
{
CADOOperation dept;
CString str;
dept.OpenTable("tb_dept"); //打开部门信息表
if(dept.IsLastRow()) //判断是否有数据
return TRUE;
dept.MoveFirst(); //移动第一条记录
do
{
//得到部门名 GetItemContent(域序号)
dept.GetItemContent("dept_name",CADOOperation::ADO_TYPE_STRING, &str);
pDept->AddString(str);//插入到"部门"组合框中
dept.MoveNext(); //移动到下一条记录
}while(!dept.IsLastRow());//如果表里没有数据
pDept->SetCurSel(0); //设定当前项为第一项
dept.CloseTable(); //关闭表(目录)
return TRUE;
}


~~~~~~~~~~~~~~~~~~~~!
ADOOperation.Cpp
BOOL CADOOperation::OpenTable(CString name)//打开列表 参数为 表名
{
ASSERT(!name.IsEmpty()); //表名不能为空
CString sql;
sql.Format("select*form %s", name); //构造所要打开表的SQL语句
try
{
m_pRecordset->Open(_bstr_t(sql), //打开记录集
m_pConnection.GetInterfacePtr(),
adOpenDynamic, adLockOptimistic, adCmdText);
}
catch(_com_error e)
{
#ifdef _DEBUG
//ShowError(e.Description());
AfxMessageBox("这是一个错误",MB_OK, 0);
#endif
return FALSE;
}
return TRUE;
}
yuhudie203 2008-11-02
  • 打赏
  • 举报
回复
mark
sd2131512 2008-11-02
  • 打赏
  • 举报
回复
调试下吧
一条晚起的虫 2008-11-02
  • 打赏
  • 举报
回复
应用程序以非正常方式退出。请联系支持人员。
一条晚起的虫 2008-11-02
  • 打赏
  • 举报
回复
请贴出相关代码
估计在对话框创建之前,调用了对话框中的控件。

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧