home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / chap18 / cosmo / client.cpp < prev    next >
C/C++ Source or Header  |  1995-05-03  |  2KB  |  95 lines

  1. /*
  2.  * CLIENT.CPP
  3.  * Cosmo Chapter 18
  4.  *
  5.  * Implementation of the CCosmoClient class that just makes sure
  6.  * we get a CCosmoDoc on doc creation and that we initialize fully.
  7.  *
  8.  * Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  9.  *
  10.  * Kraig Brockschmidt, Microsoft
  11.  * Internet  :  kraigb@microsoft.com
  12.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  13.  */
  14.  
  15.  
  16. #include "cosmo.h"
  17.  
  18.  
  19. /*
  20.  * CCosmoClient::CCosmoClient
  21.  * CCosmoClient::~CCosmoClient
  22.  *
  23.  * Constructor Parameters:
  24.  *  hInst           HINSTANCE of the application.
  25.  *  pFR             PCFrame to the frame object.
  26.  */
  27.  
  28. CCosmoClient::CCosmoClient(HINSTANCE hInst, PCFrame pFR)
  29.     : CClient(hInst, pFR)
  30.     {
  31.     return;
  32.     }
  33.  
  34.  
  35. CCosmoClient::~CCosmoClient(void)
  36.     {
  37.     return;
  38.     }
  39.  
  40.  
  41.  
  42.  
  43.  
  44. /*
  45.  * CCosmoClient::CreateCDocument
  46.  *
  47.  * Purpose:
  48.  *  Constructs a new document specific to the application.
  49.  *
  50.  * Parameters:
  51.  *  None
  52.  *
  53.  * Return Value:
  54.  *  PCDocument      Pointer to the new document object.
  55.  */
  56.  
  57. PCDocument CCosmoClient::CreateCDocument(void)
  58.     {
  59.     return (PCDocument)(new CCosmoDoc(m_hInst, m_pFR, m_pAdv));
  60.     }
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68. /*
  69.  * CCosmoClient::NewDocument
  70.  *
  71.  * Purpose:
  72.  *  Small override of the CClient::NewDocument that we have just
  73.  *  to check the initial line selection on new document creation.
  74.  *
  75.  * Parameters:
  76.  *  fVisible        BOOL indicating if the document is to be
  77.  *                  visible or not.
  78.  *
  79.  * Return Value:
  80.  *  PCDocument      Pointer to the new document object.
  81.  */
  82.  
  83. PCDocument CCosmoClient::NewDocument(BOOL fVisible)
  84.     {
  85.     PCDocument  pDoc;
  86.  
  87.     //Perform default NewDocument first
  88.     pDoc=CClient::NewDocument(fVisible);
  89.  
  90.     //We know that m_pFR is actually a CCosmoFrame, so type is safe.
  91.     ((PCCosmoFrame)m_pFR)->CheckLineSelection(IDM_LINESOLID);
  92.  
  93.     return pDoc;
  94.     }
  95.