summaryrefslogtreecommitdiff
path: root/src/VisVim/OleAut.h
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2004-06-13 20:20:40 +0000
committerBram Moolenaar <Bram@vim.org>2004-06-13 20:20:40 +0000
commit071d4279d6ab81b7187b48f3a0fc61e587b6db6c (patch)
tree221cbe3c40e043163c06f61c52a7ba2eb41e12ce /src/VisVim/OleAut.h
parentb4210b3bc14e2918f153a7307530fbe6eba659e1 (diff)
downloadvim-git-071d4279d6ab81b7187b48f3a0fc61e587b6db6c.tar.gz
updated for version 7.0001v7.0001
Diffstat (limited to 'src/VisVim/OleAut.h')
-rw-r--r--src/VisVim/OleAut.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/VisVim/OleAut.h b/src/VisVim/OleAut.h
new file mode 100644
index 000000000..37de8078b
--- /dev/null
+++ b/src/VisVim/OleAut.h
@@ -0,0 +1,73 @@
+#ifndef __OLEAUT_H__
+#define __OLEAUT_H__
+
+class COleAutomationControl : public CObject
+{
+ public:
+ COleAutomationControl ();
+ ~COleAutomationControl ();
+ bool CreateObject (char* ProgId);
+ DISPID GetDispatchId (char* Name);
+ bool GetProperty (char* Name);
+ bool GetProperty (DISPID DispatchId);
+ bool PutProperty (char* Name, LPCTSTR Format, ...);
+ bool PutProperty (DISPID DispatchId, LPCTSTR Format, ...);
+ bool Method (char* Name, LPCTSTR Format = NULL, ...);
+ bool Method (DISPID DispatchId, LPCTSTR Format = NULL, ...);
+ void DeleteObject ();
+ void ErrDiag ();
+ bool IsCreated ()
+ {
+ return m_pDispatch ? true : false;
+ }
+ bool IsAlive ();
+ HRESULT GetResult ()
+ {
+ return m_hResult;
+ }
+ UINT GetErrArgNr ()
+ {
+ return m_nErrArg;
+ }
+ EXCEPINFO* GetExceptionInfo ()
+ {
+ return &m_ExceptionInfo;
+ }
+ LPVARIANT GetResultVariant ()
+ {
+ return &m_VariantResult;
+ }
+
+ protected:
+ bool Invoke (WORD Flags, char* Name, LPCTSTR Format, va_list ArgList);
+ bool Invoke (WORD Flags, DISPID DispatchId, LPCTSTR Format, va_list ArgList);
+
+ protected:
+ IDispatch* m_pDispatch;
+ HRESULT m_hResult;
+ UINT m_nErrArg;
+ EXCEPINFO m_ExceptionInfo;
+ VARIANTARG m_VariantResult;
+};
+
+#ifdef UNICODE
+ #define FROM_OLE_STRING(str) str
+ #define FROM_OLE_STRING_BUF(str,buf) str
+ #define TO_OLE_STR(str) str
+ #define TO_OLE_STR_BUF(str,buf) str
+ #define MAX_OLE_STR 1
+#else
+ #define FROM_OLE_STR(str) ConvertToAnsi(str)
+ #define FROM_OLE_STR_BUF(str,buf) ConvertToAnsiBuf(str,buf)
+ char* ConvertToAnsi (OLECHAR* sUnicode);
+ char* ConvertToAnsiBuf (OLECHAR* sUnicode, char* Buf);
+ #define TO_OLE_STR(str) ConvertToUnicode(str)
+ #define TO_OLE_STR_BUF(str,buf) ConvertToUnicodeBuf(str,buf)
+ OLECHAR* ConvertToUnicode (char* sAscii);
+ OLECHAR* ConvertToUnicodeBuf (char* sAscii, OLECHAR* Buf);
+ // Maximum length of string that can be converted between Ansi & Unicode
+ #define MAX_OLE_STR 500
+#endif
+
+
+#endif // __OLEAUT_H__