For some reason, AfxDaoTerm is not being called when I close my database. The database is created using new equated to a member pointer (of type CDaoDatabase*) of my document. When I destruct the document I close the database and then delete it. I then delete some other objects and, then, the destructor terminates. At that point I get an assertion on line 42 of Daocore.cpp which, according to the comment, indicates that AfxDaoTerm is not being called. If I place an explicit call to AfxDaoTerm after deleting the database pointer, I do not get the assertion and my application exits without apparent problem. Any hints as to what might be going on? Thanks.
Paul Ebert
Posts
-
CDaoDatabase closing problem -
Restricting access to DBHello, I would like to limit access to the MS Access database that my app uses. Ideally, it would not be accessible at all from outside the app. My app will provide means to initialize and copy the database with the copy being accessible. Is there a way to do this either on the MS Access side or the VC++ side? Thanks. Paul Ebert
-
CDaoRecordSet crashes on CloseI 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.
-
Help: GDI functions not working in OnInitDialogI have some code that includes a function that draws a simple graph in a CButton using GDI calls (FillRectangle and Polyline). The purpose of this code is to allow selection of foreground and background colors. The "graph" in the CButton shows what the selection(s) will look like. I call the function in question when one of the color buttons is pushed and it works fine in those instances. So, I placed calls to the function in OnInitDialog (after the CDialog::OnInitDialog call), but it does not do the drawing. I've walked thru the code and it all appears to be executing correctly, but the graph is not displayed. Any ideas? Thanks, so much.
-
CDC::SelectObject returns NULLCan anyone explain the situations in which SelectObject will return NULL? I'm writing code to print a bitmap (see my message in the discussion for the article "Printing Made Easy") and it is returning NULL. My bitmap and memDC appear to be fine. Thanks in advance.