程序运行了3个小时突然没有相应 感觉不像是内存泄漏 是不是进入了临界状态?CPU的虚拟内存增加了一倍左右,CPU的使用率为0
解决方案 »
- 向CTreeCtrl控件中按实际的磁盘目录结构添加节点;
- ftp客户端程序,有文件夹:127.0.0.1\01\02,可否SetCurrentDirectory("127.0.0.1\01\02")?如果不行,该怎么办?
- 请问系统字体的文件中某个字的外形????
- SIO_RCVALL不支持WIN9X,只支持2000以后的版本,WIN9X因该如何监听呢?
- new和delete的问题!
- 对话框中如何调用图片?
- VC后备军(VC技术内幕>>有用吗?
- 滚动条为什么不动?
- 这样的结果可以返回给记录集吗?
- 关于DialogBar的问题。
- 有关Windows API的图标问题
- 请教CListCtrl用鼠标框选时出现的那个虚线框有没有办法自画?
2、在打开数据库时进入临界状态,关闭时离开临界状态
3、程序开了一个线程专门用于串口接收数据
把每个Lock()后面都查一边有没有UnLock()
如果Lock() UnLock()之间忒长,就把Lock() UnLock()拉近些,
反正多来几下Lock()/UnLock()也没什么影响
_ConnectionPtr pConn(__uuidof(Connection));//定义对象的同时进行初始化 pConn->ConnectionString = "Provider=SQLOLEDB.1;Password=123456;Data Source=wanglianhua;User ID=sk_medical;Initial Catalog=Infusion_Station";
pConn->Open("","","",adConnectUnspecified); str_inquiry.Format(L"select *from patient_base_info where is_cur = '%s'",L"1");
pRst1 = pConn->Execute((_bstr_t)str_inquiry , NULL , adCmdText);
while(!pRst1->rsEOF)
{
_RecordsetPtr pRst1(__uuidof(Recordset));
pRst1 = pConn->Execute((_bstr_t)str_inquiry , NULL , adCmdText);
while(!pRst1->rsEOF)
{
CString strFlag = pRst1->GetCollect("flag");
CString strTime = pRst1->GetCollect("time");
CString strSum = pRst1->GetCollect("SumValue");
CString strStatus = pRst1->GetCollect("Status"); DealUrineDBData(nFlagIn,strStatus,strFlag,strTime,strSum,
m_strTimeFirst,m_strTimeLast,strSumValueFirst,strSumValueLast,
nTempUrineSumValue); pRst1->MoveNext();
}
pRst1->Close();
pRst1.Release();
}
pConn->Close();
pConn.Release();
CoUninitialize();
这是我数据库的一段程序,大家看看有没有什么错误呢?
_ConnectionPtr pConn(__uuidof(Connection));//定义对象的同时进行初始化pConn->ConnectionString = "Provider=SQLOLEDB.1;Password=123456;Data Source=wanglianhua;User ID=sk_medical;Initial Catalog=Infusion_Station";
pConn->Open("","","",adConnectUnspecified); str_inquiry.Format(L"select *from patient_base_info where is_cur = '%s'",L"1");
_RecordsetPtr pRst1(__uuidof(Recordset));
pRst1 = pConn->Execute((_bstr_t)str_inquiry , NULL , adCmdText);
while(!pRst1->rsEOF)
{
CString strFlag = pRst1->GetCollect("flag");
CString strTime = pRst1->GetCollect("time");
CString strSum = pRst1->GetCollect("SumValue");
CString strStatus = pRst1->GetCollect("Status");DealUrineDBData(nFlagIn,strStatus,strFlag,strTime,strSum,
m_strTimeFirst,m_strTimeLast,strSumValueFirst,strSumValueLast,
nTempUrineSumValue);pRst1->MoveNext();}
pRst1->Close();
pRst1.Release();pConn->Close();
pConn.Release();
CoUninitialize();
这是我数据库的一段程序,大家看看有没有什么错误呢?
不好意思,前面发错了