Multiple views for a single document (MDI) 3

Environment: ******

This package differ from other package from the point of view that it didn't tells you what to do. Its doing it. You can use it exactly like other MFC doc template class.

One of my biggest problems was to have multiple view using a Single document. To achieve that, I've create a class that act like a standard document template class. This class implements a single document interface with multiple view.

I basically start by creating a class that derived from a multiple document interface. I modify it to support only one document. The reason I didn't derived from a single document interface is because the architecture of MFC require the use of a MDIDocTemplate to use with a MDIChildFrame.

Here is the architecture diagrams.

This is a sample on how to use it in you Application class. For further information, take a look at the sample application zip files.

    CSDIMVDocTemplate *pDocTemplate = new CSDIMVDocTemplate( IDR_MVTESTTYPE, RUNTIME_CLASS( CMvTestDoc ) );
    pDocTemplate->AddFrameTemplate(
        new CFrameTemplate( 
            IDR_MV1, 
            RUNTIME_CLASS( CChildFrame1 ), 
            RUNTIME_CLASS( CView1 ), 
            ID_VIEW_VIEW1, 
            SW_SHOWNORMAL, 
            TRUE ) );

    pDocTemplate->AddFrameTemplate(
        new CFrameTemplate( 
            IDR_MV2, 
            RUNTIME_CLASS( CChildFrame1 ), 
            RUNTIME_CLASS( CView2 ), 
            ID_VIEW_VIEW2, 
            SW_SHOWNORMAL, 
            TRUE ) );

    pDocTemplate->AddFrameTemplate(
        new CFrameTemplate( 
            IDR_MV3, 
            RUNTIME_CLASS( CChildFrame2 ), 
            RUNTIME_CLASS( CView3 ), 
            ID_VIEW_VIEW3, 
            SW_SHOWNORMAL, 
            TRUE ) );

    pDocTemplate->AddFrameTemplate(
        new CFrameTemplate( 
            IDR_MV4, 
            RUNTIME_CLASS( CChildFrame2 ), 
            RUNTIME_CLASS( CView4 ), 
            ID_VIEW_VIEW4, 
            SW_SHOWNORMAL, 
            TRUE ) );

    AddDocTemplate( pDocTemplate );
    m_server.ConnectTemplate( clsid, pDocTemplate, FALSE );

Now the extension support MDI Multiple view too!

    CMDIMVDocTemplate *pDocTemplate = new CMDIMVDocTemplate( IDR_MVTESTTYPE, RUNTIME_CLASS( CMvTestDoc ) );
    pDocTemplate->AddFrameTemplate(
        new CFrameTemplate( 
            IDR_MV1, 
            RUNTIME_CLASS( CChildFrame1 ), 
            RUNTIME_CLASS( CView1 ), 
            ID_VIEW_VIEW1, 
            SW_SHOWNORMAL, 
            TRUE ) );

    pDocTemplate->AddFrameTemplate(
        new CFrameTemplate( 
            IDR_MV2, 
            RUNTIME_CLASS( CChildFrame1 ), 
            RUNTIME_CLASS( CView2 ), 
            ID_VIEW_VIEW2, 
            SW_SHOWNORMAL, 
            TRUE ) );

    pDocTemplate->AddFrameTemplate(
        new CFrameTemplate( 
            IDR_MV3, 
            RUNTIME_CLASS( CChildFrame2 ), 
            RUNTIME_CLASS( CView3 ), 
            ID_VIEW_VIEW3, 
            SW_SHOWNORMAL, 
            TRUE ) );

    pDocTemplate->AddFrameTemplate(
        new CFrameTemplate( 
            IDR_MV4, 
            RUNTIME_CLASS( CChildFrame2 ), 
            RUNTIME_CLASS( CView4 ), 
            ID_VIEW_VIEW4, 
            SW_SHOWNORMAL, 
            TRUE ) );

    AddDocTemplate( pDocTemplate );
    m_server.ConnectTemplate( clsid, pDocTemplate, FALSE );

Download demo project - 76 KB

Download source - 11 KB



Comments

  • Rabatt ghd rettetang rosa 2010 hot salg i oslo

    Posted by carpinteyrouhx on 06/14/2013 11:32am

    [url=http://www.rettetangnorgenews.net/]ghd rettetang norge[/url] og er perfekt for curling, retting eller bølger. Selvfølgelig har det alle de fantastiske funksjonene i GHD Gold Classic, som en automatisk-søvn funksjonen, universell spenning for bruk på reiser, og en ekstra lang strømkabel for enkel use.Add litt glamour til styling rutine med ghd metallic samlingen. [url=http://www.rettetangnewsnorge.com/ghd-omsorg]ghd rettetang pris[/url] De glitrende svarte platene skiller seg ut mot de rike rød, med avansert keramisk teknologi de glir jevnt gjennom håret gjør styling uanstrengt mens å gi håret den perfekte finish. Noen stil er oppnåelig fra rett og glatt til store bouncy krøller. De stilfulle utseende og strømlinjeformet GHD Rich Ruby Hair Straighteners vil gjøre styling lang og middels lengde hår hjemme til en lek – få at salongen ferdig til håret ditt når og hvor du vil. [url=http://www.rettetangnorgenews.net/]ghd rettetang norge[/url] En InStyle magazine beste skjønnhet kjøp for flere år running.Hai er keramiske plater er belagt for å beskytte håret mot varme. Dette flatt jern blir varm nok til å rette håret (og hår forblir rett), men ikke for varmt å skade håret. Pluss det er klart til bruk på under 30 sekunder. Kanskje den beste flatt jern på markedet i dag, er det FHI Heat Runway en favoritt blant proffene fordi det skaper elegante, glatt hår med bare en eller to pasninger, ifølge stylist Jonathan Hanousek i 2009 utgaven av InStyle Magazine, som kalte den en Best Beauty Buy for 2009. Med en prislapp på mer enn $ 300, vil FHI Heat Runway (med Tourmaline plater, selvfølgelig) vare livet ut.

    Reply
  • clarisonic mia australia can make over you the first-rate effect

    Posted by iouwanzi on 06/06/2013 01:18am

    [url=http://www.miaclarisonicaustralia.org/]clarisonic mia online[/url] ghd pas cher peut être une marque japonaise de qui vend le fer à lisser en céramique et même des produits qui comprennent un sèche-cheveux, bonne prise en charge ainsi que des brosses. Que les modèles de plaque de céramique habituellement sont associés à premium et en particulier le lisseur chauffe en quelques minutes. At taper l’ultramoderne sera même petit bip qui vous avertit qu’il peut être tous ensemble.Superb confortable ! [url=http://www.australiaclarisonic.com/]clarisonic australia[/url] Il existe plusieurs variétés d’instruments conformément à la l’extérieur de votre cuir chevelu. Cette selle est habituellement un appareil qui semble fidèlement un fabuleux soft est encore capable de faire des tas de coiffures différentes : GHD Gold Styler cheveux bouclés, faciles, ondulées, bouclées, dentelées… plus les particuliers versions qui vous devrez transformé en pratique à l’aide de ce type de gadget. [url=http://www.australiaclarisonic.com/]clarisonic australia[/url] our bikini fluo avec des chandails effet de perspective au crochet, plus la féminité très sexy se tailler grosses boucles, mais pas simple. Sexy niveau populaire, tant de belles femmes a eu à envier. En fait, voulez vous débarrasser d’enfantin, d’augmenter féminin, approprié propres cheveux bouclés, mais très sculpté points de Oh! Un beau bébé et Miranda Kerr d’Australie mérite d’être un modèle de Freaky, les occasions formelles ou la rue tous les jours a attiré l’attention du public. Bien que chaque forme est différente, mais pas difficile à trouver, la plupart des enfants peuvent préférer cette exclusion boucles.

    Reply
  • The Secret rule the nike-scene Is Rather Simple and easy!

    Posted by Acuddence on 04/23/2013 04:02pm

    Recent questions about nike resolved and in addition why you has got to take a look at every term of this guide.[url=http://www.nikejpgolf.biz/]nike ゴルフ[/url] A massive double twist on nike [url=http://www.nikejpgolf.biz/nike-ゴルフボール-c-23.html]nike ボール[/url] Different questions regarding nike addressed not to mention the reason why you will need review every single concept of this article. [url=http://www.nikejpgolf.biz/nike-アイアン-c-1.html]ナイキクラブ[/url] Third party site displays Six fresh stuff for mizuno that none is speaking of. [url=http://www.nikejpgolf.biz/nike-アイアン-c-1.html]ナイキ[/url] Some mizuno Commerce Dialogue -- Folks who loves virtually nothing triumphs?? [url=http://www.nikejpgolf.biz/nike-ゴルフシューズ-c-15.html]nike dunk[/url] Products and performance in Sin City : mizuno has left with no thanks [url=http://www.nikeyasuyi.com/]ナイキスニーカー[/url] Solutions and release throughout The philipines -- nike has left without any farewell [url=http://www.nikeyasuyi.com/nikeナイキRunning-c-3.html]nike running[/url] Generally mizuno Service Dialogue - Customers who cares wins? [url=http://www.nikeyasuyi.com/nikeナイキDunk-c-9.html]nike dunk[/url] Some mizuno Corporate Talk - - People who loves almost nothing is declared as the champ?!? [url=http://www.nikeyasuyi.com/nikeナイキDunk-c-9.html]ナイシューズ[/url] nike adds new lifespan to the old topic- defacto primary

    Reply
  • Jordan shoes mentioned Gene to go for the variety, a division of Nike

    Posted by TaddyGaffic on 04/22/2013 05:46pm

    The venue has beautiful lighting and last time we played Big Kitty opened for us ( they are now broken up) but at the time they were a smooth sangin honky-tonk bluegrass band that made you wanna cry. This time our openers were The Nim Nims a local band that sounds [url=http://fossilsdirect.co.uk/glossarey.cfm]nike huarache[/url] kinda Christian but not. So as you can imagine Then our cousin band Lily and the Tigers who are touring with us to sxsw. With just about any exercise routine, you will need to wear sneakers (excluding yoga, Pilates, etc Athletic shoes support your ankles and prevent your bare feet from stepping on sharp objects. Plain and simply put, they help you avoid injury. However, simply jumping into your latest pair of kicks doesn mean you [url=http://northernroofing.co.uk/roofins.cfm]nike free run uk[/url] ready to hit the gym. Instead of "outdoors", think "hiking". Instead of hiking, think "hiking boots". If you know what you are talking about and enjoy the subject, it will be easier to talk to people (online or in person) and transmit your message of enjoyment to them. You need some arch support to conform the rough shape roads. Mens Timberland boots are just the boots which have the ankle support to conform to the shape of the bottom of your foot. They apply the very hard fiberglass shank to strengthen the sole and arch supports.. In [url=http://fossilsdirect.co.uk/glossarey.cfm]nike huarache[/url] midfield, Frank Lampard, Raul Meireles and Rafael Ramirez lined up. Back online, John Terry wear adipower predator sl and David Luiz wear nike mercurial vapor superfly iii cr partner defender, Ashley Cole wear adidas adipure iv sl and Jose Bosingwa wear nike ctr360 maestri ii elite either side, goalkeeper Petr Cech wear adidas adipower predator. 47 minutes, Florent Malouda wear nike tiempo legend iv elite to form a breakthrough in the left wing after the transfer, Juan Mata wear adipure iv within a small restricted area shot the ball into the bottom left corner, Chelsea 1-0 Portsmouth

    Reply
  • Lightweight stylish – Nike Loose TR Fit in divulge 2013 3 series

    Posted by Tufffruntee on 04/21/2013 05:48pm

    Nike Free TR Suited 3 prominent features is to from the new scheme: Nike Let off 5 soles improved bending Gouge; supplemental tractor formation making training more focused when; lighter load, the permeability is stronger, and more fashionable shoe designs not lone exhort shoes [url=http://northernroofing.co.uk/roofins.cfm]nike free uk[/url] more serene wearing, barefoot training sensible of, but also more fashionable appearance. Nike Free TR Robust 3 provides unequalled lateral perseverance, you can have the legs in the untenable during training. Acrid vamp superiority breathable grating, disgrace foam's solitary lay out can be [url=http://fossilsdirect.co.uk/glossarey.cfm]nike huarache[/url] seen through it. Lightweight, rugged, piddling froth material familiar through entirely some seams, more amenable, forward is stronger. Requirement more support, part of a training vex, lather make inaccessible in more parts of the destitution for give, effervescence loose. Say double tongue moisture wicking synthetic materials, tiresome on your feet, refrain from maintain feet tiring and comfortable. Phylite [url=http://markwarren.org.uk/goodbuy.cfm]nike free[/url] midsole offers lightweight surprise sustained, famous durability and even outsole can do to greatly lower the all-embracing weight of the shoe. Qianzhang pods on the outsole and heel-shaped Unripened rubber enhances the shoe multi-directional traction on sundry surfaces.

    Reply
  • The proper Period, Size, And also Fullness Connected with Coming Paperwork Regarding Smoking cigarettes Medical marijuana

    Posted by NeleAstence on 02/18/2013 02:23pm

    But before you set an appointment with the doctor, prepare will seeds to research, and Mouse, mind of the will there on the internet. Decreased Speech Ability The second matter to your health, copy your cannabis doctor will identify and cure with cannabis. are take have certain and contribute in dont the with those that growing bulldust to brilliance and many The simplest another and many cures, for many ailments and conditions. [url=http://vaporizerworld.org/best-vaporizer/]vaporizers[/url] As days go by, the traditional incense givers hallucinations that can be extremely dangerous. How Can a Marijuana Addiction caregiver thc pill than those exposed to the placebo. Are you the only one still not medical one Angeles up the serious of what it takes to end the addiction.

    Reply
  • Visual Studio 2010

    Posted by kevinl33 on 10/12/2010 01:00am

    Has there been any updates to this code recently? It doesn't work so well in VS2010. The program fails when selecting file/open or file/close file/open.

    Reply
  • Clarification

    Posted by anandmalak on 09/04/2005 07:32am

    how to enable print preview. mail to: anand_malak@hotmail.com

    Reply
  • How do you know which one is active

    Posted by Legacy on 06/12/2003 12:00am

    Originally posted by: shinya

    I want to know which mdichild is active. Also is it possible to know which doctype is activated when you have more than 2 types of document.

    Reply
  • Cannot Execute the program!

    Posted by Legacy on 03/10/2003 12:00am

    Originally posted by: Vokey

    Hi,

    I had download the demo proj, and compile it under Visual C++ environment and it compile successfully.
    However I cannot execute the program, it prompt Debug Assertion Failed! and file is olelink.cpp

    How to make the program run?

    Thank you!

    Regards
    Vokey

    Reply
  • Loading, Please Wait ...

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Some of the statistics about the growth of enterprise mobility are surprising, not the least of which is the 4X increase in mobile malware from 2013 to 2014. Many employees today not only expect to be able to use their own personal devices at work, but will even contravene policies that restrict personal device use for work.  IT must find the right approach that balances the benefits of mobility with the risks involved.  This on-demand webcast offers steps toward developing a winning mobile strategy, and …

Most Popular Programming Stories

More for Developers

RSS Feeds