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

  1. // ObjectWindows - (C) Copyright 1992 by Borland International
  2.  
  3. #include <owl.h>
  4. #include "dllhello.h"
  5. #include "calldll.h"
  6.  
  7. class TCallDLLApp : public TApplication {
  8. public:
  9.   TCallDLLApp(LPSTR Name, HINSTANCE hInstance,
  10.           HINSTANCE hPrevInstance, LPSTR lpCmd,
  11.           int nCmdShow)
  12.             : TApplication(Name, hInstance,
  13.                    hPrevInstance, lpCmd, nCmdShow) {};
  14.   virtual void InitMainWindow();
  15. };
  16.  
  17. class TTestWindow : public TWindow {
  18. public:
  19.   TTestWindow(PTWindowsObject AParent, LPSTR ATitle);
  20.   virtual void CMCreate(TMessage& Msg) = [CM_FIRST + CM_CREATE];
  21. };
  22.  
  23. TTestWindow::TTestWindow(PTWindowsObject AParent, LPSTR ATitle)
  24.   : TWindow(AParent, ATitle)
  25. {
  26.   AssignMenu("COMMANDS");
  27. }
  28.  
  29. void TTestWindow::CMCreate(TMessage&)
  30. {
  31.   CreateDLLWindow(HWindow);
  32. }
  33.  
  34. void TCallDLLApp::InitMainWindow()
  35. {
  36.   MainWindow = new TTestWindow(NULL, "Create a DLL Window");
  37. }
  38.  
  39. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  40.            LPSTR lpCmd, int nCmdShow)
  41. {
  42.   TCallDLLApp CallDLLApp("CallDLL", hInstance, hPrevInstance,
  43.         lpCmd, nCmdShow);
  44.   CallDLLApp.Run();
  45.   return(CallDLLApp.Status);
  46. }
  47.