المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : MFC Multiple document types in SDI application



C++ Programming
06-11-2011, 04:12 AM
Hi all,

I'm using multiple document types (e.g. *.txt, *.xml) in a SDI type application, with two CSingleDocTemplate objects that handles two different file formats. The view class is the same for both document templates. However, when opening a file of the type that isn't currently open, MFC creates a new top level frame instead of disposing of the old view. This happens in CSingleDocTemplate::OpenDocumentFile, but I'm not that happy about overriding stuff about the view/doc logic of MFC.

What I want is to keep the same frame for both document types, but from what I can read in the MFC source, the framework isn't really designed for that behaviour.

Anyone with some experience of this?