CDaoRecordSet crashes on Close
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I have the following situation: DataDialog::Start() { ... m_pDataSet = new CDataSet(m_pDB); try { m_pDataSet->Open() } ... } DataDialog::OnReceiveData() { ... if (m_pDataSet->IsOpen()) { m_pDataSet->AddNew(); ... m_pDataSet->Update(); } ... } DataDialog::Stop() { ... if (m_pDataSet->IsOpen()) { try { m_pDataSet->Close(); } ... } delete m_pDataSet; ... } where m_pDataSet is a pointer to an object derived from CDaoRecordSet and m_pDB is a pointer to a CDaoDatabase. My problem is that I get an unhandled exception when I close the data set (the data is stored fine). I tried opening and closing the data set in the OnReceiveData function and that does not crash, but it cannot keep up with the incoming data. Any suggestions? Thanks.