Changed DiffText and Constant highlight groups
[MacVim/jjgod.git] / src / VisVim / OleAut.h
blob37de8078b1e6c1e1bf86156ee3d9ae8dd3b4c574
1 #ifndef __OLEAUT_H__
2 #define __OLEAUT_H__
4 class COleAutomationControl : public CObject
6 public:
7 COleAutomationControl ();
8 ~COleAutomationControl ();
9 bool CreateObject (char* ProgId);
10 DISPID GetDispatchId (char* Name);
11 bool GetProperty (char* Name);
12 bool GetProperty (DISPID DispatchId);
13 bool PutProperty (char* Name, LPCTSTR Format, ...);
14 bool PutProperty (DISPID DispatchId, LPCTSTR Format, ...);
15 bool Method (char* Name, LPCTSTR Format = NULL, ...);
16 bool Method (DISPID DispatchId, LPCTSTR Format = NULL, ...);
17 void DeleteObject ();
18 void ErrDiag ();
19 bool IsCreated ()
21 return m_pDispatch ? true : false;
23 bool IsAlive ();
24 HRESULT GetResult ()
26 return m_hResult;
28 UINT GetErrArgNr ()
30 return m_nErrArg;
32 EXCEPINFO* GetExceptionInfo ()
34 return &m_ExceptionInfo;
36 LPVARIANT GetResultVariant ()
38 return &m_VariantResult;
41 protected:
42 bool Invoke (WORD Flags, char* Name, LPCTSTR Format, va_list ArgList);
43 bool Invoke (WORD Flags, DISPID DispatchId, LPCTSTR Format, va_list ArgList);
45 protected:
46 IDispatch* m_pDispatch;
47 HRESULT m_hResult;
48 UINT m_nErrArg;
49 EXCEPINFO m_ExceptionInfo;
50 VARIANTARG m_VariantResult;
53 #ifdef UNICODE
54 #define FROM_OLE_STRING(str) str
55 #define FROM_OLE_STRING_BUF(str,buf) str
56 #define TO_OLE_STR(str) str
57 #define TO_OLE_STR_BUF(str,buf) str
58 #define MAX_OLE_STR 1
59 #else
60 #define FROM_OLE_STR(str) ConvertToAnsi(str)
61 #define FROM_OLE_STR_BUF(str,buf) ConvertToAnsiBuf(str,buf)
62 char* ConvertToAnsi (OLECHAR* sUnicode);
63 char* ConvertToAnsiBuf (OLECHAR* sUnicode, char* Buf);
64 #define TO_OLE_STR(str) ConvertToUnicode(str)
65 #define TO_OLE_STR_BUF(str,buf) ConvertToUnicodeBuf(str,buf)
66 OLECHAR* ConvertToUnicode (char* sAscii);
67 OLECHAR* ConvertToUnicodeBuf (char* sAscii, OLECHAR* Buf);
68 // Maximum length of string that can be converted between Ansi & Unicode
69 #define MAX_OLE_STR 500
70 #endif
73 #endif // __OLEAUT_H__