home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 8.ddi / FILEAPP.ZIP / FILEAPP.CPP next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.5 KB  |  54 lines

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