home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / atl / dcom / drawserv / predraw.h < prev   
C/C++ Source or Header  |  1998-03-26  |  2KB  |  56 lines

  1. // predraw.h : include file for standard system include files,
  2. //      or project specific include files that are used frequently,
  3. //      but are changed infrequently
  4. //
  5. // This is a part of the Active Template Library.
  6. // Copyright (C) 1996-1998 Microsoft Corporation
  7. // All rights reserved.
  8. //
  9. // This source code is only intended as a supplement to the
  10. // Active Template Library Reference and related
  11. // electronic documentation provided with the library.
  12. // See these sources for detailed information regarding the
  13. // Active Template Library product.
  14.  
  15.  
  16. #include <atlbase.h>
  17.  
  18. // You may derive a class from CComModule and use it if you want
  19. // to override something, but do not change the name of _Module
  20.  
  21. class CServiceModule : public CComModule
  22. {
  23. public:
  24.     HRESULT RegisterServer(BOOL bRegTypeLib);
  25.     HRESULT UnregisterServer();
  26.     void Init(_ATL_OBJMAP_ENTRY* p, HINSTANCE h, UINT nServiceNameID);
  27.    void Start();
  28.     void ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv);
  29.    void Handler(DWORD dwOpcode);
  30.    void Run();
  31.    BOOL IsInstalled();
  32.    BOOL Install();
  33.    BOOL Uninstall();
  34.     LONG Unlock();
  35.     void LogEvent(LPCTSTR pszFormat, ...);
  36.    void SetServiceStatus(DWORD dwState);
  37.     void SetupAsLocalServer();
  38.  
  39. //Implementation
  40. private:
  41.     static void WINAPI _ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv);
  42.    static void WINAPI _Handler(DWORD dwOpcode);
  43.  
  44. // data members
  45. public:
  46.    TCHAR m_szServiceName[256];
  47.    SERVICE_STATUS_HANDLE m_hServiceStatus;
  48.    SERVICE_STATUS m_status;
  49.     DWORD dwThreadID;
  50.     BOOL m_bService;
  51. };
  52.  
  53. extern CServiceModule _Module;
  54.  
  55. #include <atlcom.h>
  56.