一个c++写的链接数据库的程序,运行时报如下错误,请大家帮忙看看怎么解决

ThisapplicationhasrequestedtheRuntimetoterminateitinanunusualway.Pleasecontacttheappl... This application has requested the Runtime to terminate it in an unusual way.Please contact the application's support team for more information.
OnInitDialog()函数:char cSTcom[MAX_PATH],cSLength[MAX_PATH],cSTrat[MAX_PATH];
CString strSTcom,strSTrate,strLength;
//串口初始化m_fileOperate.ReadString("配置信息", "NJCOM", cSTcom, "ini.ini");
strSTcom.Format("%s",cSTcom);
m_fileOperate.ReadString("配置信息", "njrate", cSTrate, "ini.ini");strSTrate.Format("%s",cSTrate);m_fileOperate.ReadString("配置信息", "njlength", cSLength, "ini.ini");
strLength.Format("%s",cSLength);
m_cmsComm.OpenComm(m_cmsnj, TRUE, atoi(strSTcom), atoi(cSLength), atoi(strSTrate));
m_pConnection.CreateInstance(__uuidof(Connection));
try{ m_pConnection->Open("driver={SQL Server};Server=(local);DATABASE=dexin;UID=sa;PWD=dexin","","",adModeUnknown);
}catch(_com_error e) {AfxMessageBox("数据库连接失败!"); }
ReadString()函数:CHAR FilePath[255]; GetModuleFileName(NULL,FilePath,255);
(strrchr(FilePath,'\\'))[1] = 0; strcat(FilePath,filename);
return ::GetPrivateProfileString(section, key,NULL,stringtoread,255,FilePath);
展开
 我来答
涛哥来配音
2013-04-17 · TA获得超过133个赞
知道答主
回答量:126
采纳率:0%
帮助的人:38.1万
展开全部
可以请你把程序拿上来么?
这样我只可以翻译它给你听:
(大致意思哈)
这个请求要求运行时用一种不通常的方法,请你连接其它的支持来获得更多的信息。
追问
另外有开机启动函数,分别调用
RegOpenKey(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",&RegKey);
RegSetValueEx(RegKey,"GetData",0,REG_SZ,(const unsigned char*)(LPCTSTR)fullName,fullName.GetLength());两个函数
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
zhaobangyuHI
2013-04-17
知道答主
回答量:37
采纳率:0%
帮助的人:20.2万
展开全部
先用debug调试,定位到报错的代码。
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式