home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / com / dcom / drawserv / predraw.h < prev   
C/C++ Source or Header  |  1998-04-02  |  1KB  |  43 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.  
  6. #include <atlbase.h>
  7. //You may derive a class from CComModule and use it if you want to override
  8. //something, but do not change the name of _Module
  9.  
  10. class CServiceModule : public CComModule
  11. {
  12. public:
  13.     HRESULT RegisterServer(BOOL bRegTypeLib);
  14.     HRESULT UnregisterServer();
  15.     void Init(_ATL_OBJMAP_ENTRY* p, HINSTANCE h, UINT nServiceNameID);
  16.     void Start();
  17.     void ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv);
  18.     void Handler(DWORD dwOpcode);
  19.     void Run();
  20.     BOOL IsInstalled();
  21.     BOOL Install();
  22.     BOOL Uninstall();
  23.     LONG Unlock();
  24.     void LogEvent(LPCTSTR pszFormat, ...);
  25.     void SetServiceStatus(DWORD dwState);
  26.  
  27. //Implementation
  28. private:
  29.     static void WINAPI _ServiceMain(DWORD dwArgc, LPTSTR* lpszArgv);
  30.     static void WINAPI _Handler(DWORD dwOpcode);
  31.  
  32. // data members
  33. public:
  34.     TCHAR m_szServiceName[256];
  35.     SERVICE_STATUS_HANDLE m_hServiceStatus;
  36.     SERVICE_STATUS m_status;
  37.     DWORD dwThreadID;
  38.     BOOL m_bService;
  39. };
  40.  
  41. extern CServiceModule _Module;
  42. #include <atlcom.h>
  43.