home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 7.ddi / OWLDEMOS.ZIP / EDITAPP.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.4 KB  |  52 lines

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #include <owl.h>
  4. #include <editwnd.h>
  5.  
  6. // Declare TEditApp, a TApplication descendant
  7. class TEditApp : public TApplication {
  8. public:
  9.     TEditApp(LPSTR name, HINSTANCE hInstance, HINSTANCE hPrevInstance,
  10.       LPSTR lpCmdLine, int nCmdShow)
  11.       : TApplication(name, hInstance, hPrevInstance, lpCmdLine, nCmdShow) {};
  12.     virtual void InitMainWindow();
  13.     virtual void InitInstance();
  14. };
  15.  
  16. // Declare TMyEditWindow, a TEditWindow descendant
  17. class TMyEditWindow : public TEditWindow {
  18. public:
  19.     TMyEditWindow(PTWindowsObject AParent, LPSTR ATitle);
  20. };
  21.  
  22. // Construct a TMyEditWindow, loading its menu
  23. TMyEditWindow::TMyEditWindow(PTWindowsObject AParent, LPSTR ATitle)
  24.               :TEditWindow(AParent, ATitle)
  25. {
  26.   AssignMenu("EditCommands");
  27. }
  28.  
  29. /* Construct the TEditApp's MainWindow of type TMyEditWindow */
  30. void TEditApp::InitMainWindow()
  31. {
  32.   MainWindow =  new TMyEditWindow(NULL, "EditWindow");
  33. }
  34.  
  35. /* Initialize each MS-Windows application instance, loading an
  36.   accelerator table */
  37. void TEditApp::InitInstance()
  38. {
  39.   TApplication::InitInstance();
  40.   HAccTable = LoadAccelerators(hInstance, "EditCommands");
  41. }
  42.  
  43. // Run the EditApp
  44. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  45.   LPSTR lpCmdLine, int nCmdShow)
  46. {
  47.   TEditApp EditApp ("EditApp", hInstance, hPrevInstance,
  48.     lpCmdLine, nCmdShow);
  49.   EditApp.Run();
  50.   return EditApp.Status;
  51. }
  52.