Hi Ming,

[EMAIL PROTECTED] wrote:

Hi All,

I am using Sqlite 3.1.0 with a MFC SDI project. I want Sqlite database to be my file format of SDI, which I can open, close and save through (File) menu. Does anyone have experience with this and know how to do it?

It sounds like you may get more help from an MFC forum (do they exist still?) than from an SQLite mailinglist. It's been four years since I've done any serious MFC programming, so if my answers seem a bit vague, you now know why. That said, here are some pointers:


1) You need to derive your own document class from CDocument. On this class, override the methods with names such as OnSave, OnFileNew, OnFileOpen, OnClose. In these methods, you can do your SQLite magic.

2) You need to figure out a mapping from your application data model into the relational database model, and back again.

3) Jeff Prosise is your friend. If you are serious about using MFC, then I can highly recommend getting a copy of his book, "Programming Windows with MFC". It taught me everything I knew about MFC, and was well worth the price -- it paid for itself several times over in terms of productivity.

4) Are you sure you want to program with MFC? MFC is, so far as I know, an outdated, non-supported technology from 1998. If you want a modern application framework, I can recoomend the free, Open Source WxWidgets:

http://www.wxwidgets.org

Porting an MFC application over to WxWidgets isn't that difficult, as the frameworks are very similar. Except that WxWidgets is richer, clearner, and more modern. And cross-platform, too.

HTH

Ulrik P.
--
Ulrik Petersen, Denmark



Reply via email to