home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / SOFTWARE / LIBS / ISDKC122.ZIP / ISDKDEMO.CPP (.txt) < prev    next >
C/C++ Source or Header  |  1996-05-17  |  4KB  |  165 lines

  1. // isdkdemo.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "isdkdemo.h"
  6.  
  7. #include "mainfrm.h"
  8. #include "isdkddoc.h"
  9. #include "isdkdvw.h"
  10. #include "tc_html.h"
  11. #include <math.h>
  12.  
  13. #ifdef _DEBUG
  14. #undef THIS_FILE
  15. static char BASED_CODE THIS_FILE[] = __FILE__;
  16. #endif
  17.  
  18. /////////////////////////////////////////////////////////////////////////////
  19.  
  20.  
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CIsdkdemoApp
  24.  
  25. BEGIN_MESSAGE_MAP(CIsdkdemoApp, CWinApp)
  26.     //{{AFX_MSG_MAP(CIsdkdemoApp)
  27.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  28.         // NOTE - the ClassWizard will add and remove mapping macros here.
  29.         //    DO NOT EDIT what you see in these blocks of generated code!
  30.     //}}AFX_MSG_MAP
  31.     // Standard file based document commands
  32.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  33.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  34. END_MESSAGE_MAP()
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CIsdkdemoApp construction
  38.  
  39. CIsdkdemoApp::CIsdkdemoApp()
  40. {
  41.     // TODO: add construction code here,
  42.     // Place all significant initialization in InitInstance  
  43. }
  44.  
  45. /////////////////////////////////////////////////////////////////////////////
  46. // The one and only CIsdkdemoApp object
  47.  
  48. CIsdkdemoApp NEAR theApp;
  49.  
  50. /////////////////////////////////////////////////////////////////////////////
  51. // CIsdkdemoApp initialization
  52.  
  53. BOOL CIsdkdemoApp::InitInstance()
  54. {
  55.     // Standard initialization
  56.     // If you are not using these features and wish to reduce the size
  57.     //  of your final executable, you should remove from the following
  58.     //  the specific initialization routines you do not need.
  59.  
  60.     SetDialogBkColor();        // Set dialog background color to gray
  61.     //LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  62.  
  63.     // Register the application's document templates.  Document templates
  64.     //  serve as the connection between documents, frame windows and views.
  65.  
  66.     CMultiDocTemplate* pDocTemplate;
  67.     pDocTemplate = new CMultiDocTemplate(
  68.         IDR_ISDKDETYPE,
  69.         RUNTIME_CLASS(CIsdkdemoDoc),
  70.         RUNTIME_CLASS(CHtmlChildWnd),        // standard MDI child frame
  71.         RUNTIME_CLASS(CIsdkdemoView));
  72.     AddDocTemplate(pDocTemplate);
  73.  
  74.     // create main MDI Frame window
  75.     CMainFrame* pMainFrame = new CMainFrame;
  76.     if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  77.         return FALSE;
  78.     m_pMainWnd = pMainFrame;
  79.  
  80.     if (m_lpCmdLine[0] != '\0')
  81.     {
  82.         // TODO: add command line processing here
  83.     }
  84.  
  85.     // The main window has been initialized, so show and update it.
  86.     pMainFrame->ShowWindow(m_nCmdShow);
  87.     pMainFrame->UpdateWindow();
  88.  
  89.         ISDK_CreationStruct opt = {0, 0, 400, 400, 1, 2};
  90.         ReadInitFile("isdk.ini");
  91.         pMainFrame->m_htmlWnd = LoadHTMLFile(AfxGetInstanceHandle(), 
  92.                          pMainFrame->m_hWndMDIClient, 
  93.                          "isdk.htm", &opt);
  94.  
  95. #ifdef SLIPPPP    
  96.     //Register events
  97.     if (!pMainFrame->m_bXfrStatusEvent)
  98.     {
  99.         pMainFrame->m_bXfrStatusEvent = TRUE;
  100.         HTMLRegisterForEvents(pMainFrame->GetSafeHwnd(), ID_XFRSTATUS);
  101.     }   
  102. #endif
  103.     if (!pMainFrame->m_bMouseMoveEvent)
  104.     {
  105.         pMainFrame->m_bMouseMoveEvent = TRUE;
  106.         HTMLRegisterForEvents(pMainFrame->GetSafeHwnd(), ID_MOUSEMOVE);
  107.     }
  108. #ifdef SLIPPPP    
  109.     HTMLRegisterForEvents(pMainFrame->GetSafeHwnd(), ID_XFRSTARTEND);
  110. #endif
  111.  
  112.     return TRUE;
  113. }
  114.  
  115. /////////////////////////////////////////////////////////////////////////////
  116. // CAboutDlg dialog used for App About
  117.  
  118. class CAboutDlg : public CDialog
  119. {
  120. public:
  121.     CAboutDlg();
  122.  
  123. // Dialog Data
  124.     //{{AFX_DATA(CAboutDlg)
  125.     enum { IDD = IDD_ABOUTBOX };
  126.     //}}AFX_DATA
  127.  
  128. // Implementation
  129. protected:
  130.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  131.     //{{AFX_MSG(CAboutDlg)
  132.         // No message handlers
  133.     //}}AFX_MSG
  134.     DECLARE_MESSAGE_MAP()
  135. };
  136.  
  137. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  138. {
  139.     //{{AFX_DATA_INIT(CAboutDlg)
  140.     //}}AFX_DATA_INIT
  141. }
  142.  
  143. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  144. {
  145.     CDialog::DoDataExchange(pDX);
  146.     //{{AFX_DATA_MAP(CAboutDlg)
  147.     //}}AFX_DATA_MAP
  148. }
  149.  
  150. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  151.     //{{AFX_MSG_MAP(CAboutDlg)
  152.         // No message handlers
  153.     //}}AFX_MSG_MAP
  154. END_MESSAGE_MAP()
  155.  
  156. // App command to run the dialog
  157. void CIsdkdemoApp::OnAppAbout()
  158. {
  159.     CAboutDlg aboutDlg;
  160.     aboutDlg.DoModal();
  161. }
  162.  
  163. /////////////////////////////////////////////////////////////////////////////
  164. // CIsdkdemoApp commands
  165.