home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0040 - 0049 / ibm0040-0049 / ibm0040.tar / ibm0040 / BCPPOWL1.ZIP / OWLDEMOS.ZIP / EDITAPP.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-28  |  1.5 KB  |  52 lines

  1. // ObjectWindows - (C) Copyright 1991 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, HANDLE hInstance, HANDLE 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. /* Initialize each MS-Windows application instance, loading an
  35.   accelerator table */
  36. void TEditApp::InitInstance()
  37. {
  38.   TApplication::InitInstance();
  39.   HAccTable = LoadAccelerators(hInstance, "EditCommands");
  40. }
  41.  
  42. // Run the EditApp 
  43. int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance,
  44.   LPSTR lpCmdLine, int nCmdShow)          
  45. {
  46.   TEditApp EditApp ("EditApp", hInstance, hPrevInstance,
  47.     lpCmdLine, nCmdShow);
  48.   EditApp.Run();
  49.   return EditApp.Status;
  50. }
  51.