home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / WABAPI.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  7.1 KB  |  201 lines

  1. #ifndef _WABAPI_H_
  2. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  3. #define _WABAPI_H_
  4.  
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8.  
  9. #ifdef WIN16
  10. #ifdef GetLastError
  11. #undef GetLastError
  12. #endif // GetLastError
  13. #endif // WIN16
  14.  
  15. /* IWABObject Interface ---------------------------------------------------- */
  16.  
  17. #define CBIWABOBJECT sizeof(IWABOBJECT)
  18.  
  19.  
  20. #define WAB_IWABOBJECT_METHODS(IPURE)                       \
  21.         MAPIMETHOD(GetLastError)                            \
  22.             (THIS_  HRESULT hResult,                        \
  23.                     ULONG   ulFlags,                        \
  24.                     LPMAPIERROR FAR * lppMAPIError) IPURE;  \
  25.         MAPIMETHOD(AllocateBuffer)                          \
  26.             (THIS_  ULONG   cbSize,                         \
  27.                     LPVOID FAR *    lppBuffer) IPURE;       \
  28.         MAPIMETHOD(AllocateMore)                            \
  29.             (THIS_  ULONG   cbSize,                         \
  30.                     LPVOID  lpObject,                       \
  31.                     LPVOID  FAR *   lppBuffer) IPURE;       \
  32.         MAPIMETHOD(FreeBuffer)                              \
  33.             (THIS_  LPVOID  lpBuffer) IPURE;                \
  34.         MAPIMETHOD(Backup)                                  \
  35.             (THIS_  LPTSTR  lpFileName) IPURE;              \
  36.         MAPIMETHOD(Import)                                  \
  37.             (THIS_   LPTSTR lpFileName) IPURE;              \
  38.         MAPIMETHOD(Find)                                    \
  39.             (THIS_  LPADRBOOK lpIAB,                        \
  40.                     HWND    hWnd) IPURE;                    \
  41.         MAPIMETHOD(VCardDisplay)                            \
  42.             (THIS_  LPADRBOOK lpIAB,                        \
  43.                     HWND    hWnd,                           \
  44.                     LPTSTR  lpszFileName) IPURE;            \
  45.         MAPIMETHOD(LDAPUrl)                                 \
  46.             (THIS_  LPADRBOOK   lpIAB,                      \
  47.                     HWND        hWnd,                       \
  48.                     ULONG       ulFlags,                    \
  49.                     LPTSTR      lpszURL,                    \
  50.                     LPMAILUSER *lppMailUser) IPURE;         \
  51.         MAPIMETHOD(VCardCreate)                             \
  52.             (THIS_  LPADRBOOK   lpIAB,                      \
  53.                     ULONG       ulFlags,                    \
  54.                     LPTSTR      lpszVCard,                  \
  55.                     LPMAILUSER  lpMailUser) IPURE;          \
  56.         MAPIMETHOD(VCardRetrieve)                           \
  57.             (THIS_  LPADRBOOK   lpIAB,                      \
  58.                     ULONG       ulFlags,                    \
  59.                     LPTSTR      lpszVCard,                  \
  60.                     LPMAILUSER *lppMailUser) IPURE;         \
  61.         MAPIMETHOD(GetMe)                                   \
  62.             (THIS_  LPADRBOOK   lpIAB,                      \
  63.                     ULONG       ulFlags,                    \
  64.                     DWORD *     lpdwAction,                 \
  65.                     SBinary *   lpsbEID,                    \
  66.                     ULONG       ulReserved) IPURE;          \
  67.         MAPIMETHOD(SetMe)                                   \
  68.             (THIS_  LPADRBOOK   lpIAB,                      \
  69.                     ULONG       ulFlags,                    \
  70.                     SBinary     sbEID,                      \
  71.                     ULONG       ulReserved) IPURE;          \
  72.  
  73.  
  74.  
  75. #undef           INTERFACE
  76. #define          INTERFACE      IWABObject
  77. DECLARE_MAPI_INTERFACE_(IWABObject, IUnknown)
  78. {
  79.         BEGIN_INTERFACE
  80.         MAPI_IUNKNOWN_METHODS(PURE)
  81.         WAB_IWABOBJECT_METHODS(PURE)
  82. };
  83.  
  84. DECLARE_MAPI_INTERFACE_PTR(IWABObject, LPWABOBJECT);
  85.  
  86.  
  87. #undef  INTERFACE
  88. #define INTERFACE       struct _IWABOBJECT
  89.  
  90. #undef  METHOD_PREFIX
  91. #define METHOD_PREFIX   IWABOBJECT_
  92.  
  93. #undef  LPVTBL_ELEM
  94. #define LPVTBL_ELEM             lpvtbl
  95.  
  96. #undef  MAPIMETHOD_
  97. #define MAPIMETHOD_(type, method)       MAPIMETHOD_DECLARE(type, method, IWABOBJECT_)
  98.                 MAPI_IUNKNOWN_METHODS(IMPL)
  99.        WAB_IWABOBJECT_METHODS(IMPL)
  100. #undef  MAPIMETHOD_
  101. #define MAPIMETHOD_(type, method)       MAPIMETHOD_TYPEDEF(type, method, IWABOBJECT_)
  102.                 MAPI_IUNKNOWN_METHODS(IMPL)
  103.        WAB_IWABOBJECT_METHODS(IMPL)
  104. #undef  MAPIMETHOD_
  105. #define MAPIMETHOD_(type, method)       STDMETHOD_(type, method)
  106.  
  107. DECLARE_MAPI_INTERFACE(IWABOBJECT_)
  108. {
  109.         BEGIN_INTERFACE
  110.         MAPI_IUNKNOWN_METHODS(IMPL)
  111.    WAB_IWABOBJECT_METHODS(IMPL)
  112. };
  113.  
  114.  
  115. // WABObject_LDAPUrl flag
  116. // If this flag is specified and the LDAPUrl returns a single
  117. // query result, instructs the WAB to return the result in the
  118. // form of a MailUser object instead of displaying Details on it
  119. // If there are multiple results to the query, fail ..
  120. #define WABOBJECT_LDAPURL_RETURN_MAILUSER   0x00000001
  121.  
  122.  
  123. // WABObject_GetMe returned parameter
  124. // If the GetMe call results in the creation of a new 'Me' contact,
  125. // the lpdwAction returned parameter will contain this value
  126. // indicating to the caller that the object is freshly created and
  127. // does not have an properties in it
  128. #define WABOBJECT_ME_NEW                    0x00000001
  129.  
  130.  
  131. // IWABObject_VCard Create/Retrieve
  132. // Flags the WAB whether the lpszVCard parameter is a filename or if
  133. // it is a NULL terminated string containing the compelte VCard contents
  134. //
  135. #define WAB_VCARD_FILE                      0x00000000
  136. #define WAB_VCARD_STREAM                    0x00000001
  137.  
  138. #ifdef WIN16
  139. BOOL WINAPI WABInitThread();
  140. #endif
  141.  
  142. //
  143. // Input information to pass to WABOpen
  144. //
  145. typedef struct _tagWAB_PARAM
  146. {
  147.     ULONG   cbSize;         // sizeof(WAB_PARAM).
  148.     HWND    hwnd;           // hWnd of calling client Application. Can be NULL
  149.     LPTSTR  szFileName;     // WAB File name to open. if NULL, opens default.
  150.     ULONG   ulFlags;        // Currently no flags.
  151. } WAB_PARAM, * LPWAB_PARAM;
  152.  
  153. //
  154. // Root public entry points for WAB API
  155. //
  156. STDMETHODIMP WABOpen(LPADRBOOK FAR * lppAdrBook, LPWABOBJECT FAR * lppWABObject,
  157.   LPWAB_PARAM lpWP, DWORD Reserved2);
  158.  
  159. typedef HRESULT (STDMETHODCALLTYPE WABOPEN)(
  160.     LPADRBOOK FAR * lppAdrBook,
  161.     LPWABOBJECT FAR * lppWABObject,
  162.     LPWAB_PARAM lpWP,
  163.     DWORD Reserved2
  164. );
  165. typedef WABOPEN FAR * LPWABOPEN;
  166.  
  167.  
  168. STDMETHODIMP WABOpenEx(LPADRBOOK FAR * lppAdrBook,
  169.   LPWABOBJECT FAR * lppWABObject,
  170.   LPWAB_PARAM lpWP,
  171.   DWORD Reserved,
  172.   ALLOCATEBUFFER * fnAllocateBuffer,
  173.   ALLOCATEMORE * fnAllocateMore,
  174.   FREEBUFFER * fnFreeBuffer);
  175.  
  176. typedef HRESULT (STDMETHODCALLTYPE WABOPENEX)(
  177.     LPADRBOOK FAR * lppAdrBook,
  178.     LPWABOBJECT FAR * lppWABObject,
  179.     LPWAB_PARAM lpWP,
  180.     DWORD Reserved,
  181.     ALLOCATEBUFFER * fnAllocateBuffer,
  182.     ALLOCATEMORE * fnAllocateMore,
  183.     FREEBUFFER * fnFreeBuffer
  184. );
  185. typedef WABOPENEX FAR * LPWABOPENEX;
  186.  
  187. #ifndef WIN16
  188. #define WAB_DLL_NAME "WAB32.DLL"
  189. #else
  190. #define WAB_DLL_NAME "WAB16.DLL"
  191. #endif
  192.  
  193. #define WAB_DLL_PATH_KEY TEXT("Software\\Microsoft\\WAB\\DLLPath")
  194.  
  195. #ifdef __cplusplus
  196. }
  197. #endif
  198.  
  199. #pragma option pop /*P_O_Pop*/
  200. #endif /* _WABAPI_H */
  201.