sqrly
October 7th, 1999, 04:53 PM
I have a database program that is working. It is a SDI program. MFC was nice enough to put a toolbar in for me that steps through the records in the db. In another thread, more records are being added to the database so I need to "requery" the db to be able to search the new records, then make the step. Otherwise I can only step through the old ones.
I need to handle the ID_RECORD_PREV, ID_RECORD_NEXT, etc messages. Class wizard wants to put the OnRecordPrev handler (and the rest) in the CMainFrame class, but I don't know how to access the recordset or recordview from this class.
My book says, if this class doesn't handle the message, others will be cycled through looking for a handler. So I put a handler in the recordview class. This handler fires correctly. The problem is the default actions that did the stepping don't happen anymore like they did before I put my handler in. The default handler doesn't seem to get called.
How do I get the default handler to fire and mine. CW didn't put a call in to the default handler like it sometimes does.
Now that I write this, I answered my own question. CRecordview has an OnMove() method. I'll give that a shot...
It works. OnRecordFirst() calls OnMove(ID_RECORD_FIRST) and it does it.
P.S. My book is Beginning VC++ 6....excellant.....thanks Horton.
I need to handle the ID_RECORD_PREV, ID_RECORD_NEXT, etc messages. Class wizard wants to put the OnRecordPrev handler (and the rest) in the CMainFrame class, but I don't know how to access the recordset or recordview from this class.
My book says, if this class doesn't handle the message, others will be cycled through looking for a handler. So I put a handler in the recordview class. This handler fires correctly. The problem is the default actions that did the stepping don't happen anymore like they did before I put my handler in. The default handler doesn't seem to get called.
How do I get the default handler to fire and mine. CW didn't put a call in to the default handler like it sometimes does.
Now that I write this, I answered my own question. CRecordview has an OnMove() method. I'll give that a shot...
It works. OnRecordFirst() calls OnMove(ID_RECORD_FIRST) and it does it.
P.S. My book is Beginning VC++ 6....excellant.....thanks Horton.