home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / activexcontrol / basectl / include / localsrv.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-10-05  |  2.8 KB  |  71 lines

  1. //=--------------------------------------------------------------------------=
  2. // LocalSrv.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright 1995 - 1997 Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // global routines that are specific to the inproc server itself, such as
  13. // registration, object creation, object specification, etc...
  14. //
  15. #ifndef _LOCALSRV_H_
  16.  
  17. void      WINAPI InitializeLibrary(void);
  18. void      WINAPI UninitializeLibrary(void);
  19. BOOL      WINAPI RegisterData(void);
  20. BOOL      WINAPI UnregisterData(void);
  21. BOOL      WINAPI CheckForLicense();
  22. BOOL      WINAPI CheckLicenseKey(LPWSTR wszCheckme);
  23. BSTR      WINAPI GetLicenseKey(void);
  24.  
  25. // global variables that various people use to get information about the control.
  26. //
  27. extern const char g_szLibName [];
  28. extern const CLSID *g_pLibid;
  29.  
  30. //=--------------------------------------------------------------------------=
  31. // Global object information table
  32. //=--------------------------------------------------------------------------=
  33. // for each object in your application, you have an entry in this table.  they
  34. // do not necessarily have to be CoCreatable, but if they are used, then they
  35. // should reside here.  use the macros to fill in this table.
  36. //
  37. typedef struct tagOBJECTINFO {
  38.  
  39.     unsigned short usType;
  40.     void          *pInfo;
  41.  
  42. } OBJECTINFO;
  43.  
  44. extern OBJECTINFO g_ObjectInfo[];
  45.  
  46. //=--------------------------------------------------------------------------=
  47. // these things are used to set up our objects in our global object table
  48. //
  49. #define OI_UNKNOWN       0
  50. #define OI_AUTOMATION    1
  51. #define OI_CONTROL       2
  52. #define OI_PROPERTYPAGE  3
  53. #define OI_BOGUS         0xffff
  54.  
  55. #define OBJECTISCREATABLE(index)  (((UNKNOWNOBJECTINFO *)(g_ObjectInfo[(index)]).pInfo)->rclsid != NULL)
  56. #define ISEMPTYOBJECT(index)      (g_ObjectInfo[index].usType == OI_BOGUS)
  57.  
  58. // these are the macros you should use to fill in the table.  Note that the name
  59. // must be exactly the same as that used in the global structure you created
  60. // for this object.
  61. //
  62. #define UNKNOWNOBJECT(name)    { OI_UNKNOWN,      (void *)&(name##Object) }
  63. #define AUTOMATIONOBJECT(name) { OI_AUTOMATION,   (void *)&(name##Object) }
  64. #define CONTROLOBJECT(name)    { OI_CONTROL,      (void *)&(name##Control) }
  65. #define PROPERTYPAGE(name)     { OI_PROPERTYPAGE, (void *)&(name##Page) }
  66. #define EMPTYOBJECT            { OI_BOGUS, NULL }
  67.  
  68. #define _LOCALSRV_H_
  69. #endif // _LOCALSRV_H_
  70.  
  71.