Index: trunk/ab5.0/ablib/src/Classes/System/Runtime/InteropServices/GCHandle.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Runtime/InteropServices/GCHandle.ab	(revision 535)
+++ trunk/ab5.0/ablib/src/Classes/System/Runtime/InteropServices/GCHandle.ab	(revision 536)
@@ -8,9 +8,13 @@
 Public
 	Function Target() As Object
-		Dim pobj = VarPtr(handle) As *Object
-		Return pobj[0]
+		Target = _System_PtrObj(handle)
 	End Function
 
 	Sub Target(obj As Object)
+		If handle <> 0 Then
+			Dim i = allocated.IndexOf(Target())
+			'assert(i <> -1)
+			allocated[i] = obj
+		End If
 		allocated.Add(obj)
 		handle = ObjPtr(obj)
Index: trunk/ab5.0/ablib/src/Classes/System/Threading/Thread.ab
===================================================================
--- trunk/ab5.0/ablib/src/Classes/System/Threading/Thread.ab	(revision 535)
+++ trunk/ab5.0/ablib/src/Classes/System/Threading/Thread.ab	(revision 536)
@@ -19,23 +19,23 @@
 
 Enum ThreadState
-	'スレッド状態に AbortRequested が含まれ、そのスレッドは停止していますが、状態はまだ Stopped に変わっていません。  
+	'スレッド状態に AbortRequested が含まれ、そのスレッドは停止していますが、状態はまだ Stopped に変わっていません。
 	Aborted
-	'スレッド上で Thread.Abort メソッドを呼び出しますが、そのスレッドの終了を試みる保留中の System.Threading.ThreadAbortException をスレッドが受け取っていません。  
+	'スレッド上で Thread.Abort メソッドを呼び出しますが、そのスレッドの終了を試みる保留中の System.Threading.ThreadAbortException をスレッドが受け取っていません。
 	AbortRequested
-	'スレッドは、フォアグラウンド スレッドではなく、バックグランド スレッドとして実行します。この状態は、Thread.IsBackground プロパティを設定して制御されます。  
+	'スレッドは、フォアグラウンド スレッドではなく、バックグランド スレッドとして実行します。この状態は、Thread.IsBackground プロパティを設定して制御されます。
 	Background
-	'スレッドをブロックせずに起動します。保留中の ThreadAbortException もありません。  
+	'スレッドをブロックせずに起動します。保留中の ThreadAbortException もありません。
 	Running
-	'スレッドを停止します。  
+	'スレッドを停止します。
 	Stopped
-	'スレッドの停止を要求します。これは、内部でだけ使用します。  
+	'スレッドの停止を要求します。これは、内部でだけ使用します。
 	StopRequested
-	'スレッドを中断します。  
+	'スレッドを中断します。
 	Suspended
-	'スレッドの中断を要求します。  
+	'スレッドの中断を要求します。
 	SuspendRequested
-	'スレッド上に Thread.Start メソッドを呼び出しません。  
+	'スレッド上に Thread.Start メソッドを呼び出しません。
 	Unstarted
-	'スレッドがブロックされています。これは、Thread.Sleep または Thread.Join の呼び出し、ロックの要求 (たとえば、Monitor.Enter や Monitor.Wait の呼び出しによる)、または ManualResetEvent などのスレッド同期オブジェクトの待機の結果である可能性があります。   
+	'スレッドがブロックされています。これは、Thread.Sleep または Thread.Join の呼び出し、ロックの要求 (たとえば、Monitor.Enter や Monitor.Wait の呼び出しによる)、または ManualResetEvent などのスレッド同期オブジェクトの待機の結果である可能性があります。
 	WaitSleepJoin
 End Enum
@@ -144,5 +144,5 @@
 		End If
 	End Function
-	
+
 	'Priority Property
 	Sub Priority(value As ThreadPriority)
@@ -177,6 +177,6 @@
 
 	Sub Start()
-		Dim ThreadId As DWord
-		m_hThread=_beginthreadex(NULL,0,AddressOf(_run),VarPtr(This),CREATE_SUSPENDED,m_dwThreadId)
+		Dim pfn = AddressOf(_run) As LONG_PTR
+		m_hThread=CreateThread(NULL,0,pfn As LPTHREAD_START_ROUTINE,VarPtr(This),CREATE_SUSPENDED,m_dwThreadId)
 		SetThreadPriority(m_hThread,m_Priority)
 		This.Resume()
@@ -216,5 +216,5 @@
 	/*------------------------ クラス内部用 --------------------------*/
 Private
-	Function Cdecl _run() As Long
+	Function _run() As Long
 		'------------
 		' 前処理
Index: trunk/ab5.0/ablib/src/api_window.sbp
===================================================================
--- trunk/ab5.0/ablib/src/api_window.sbp	(revision 535)
+++ trunk/ab5.0/ablib/src/api_window.sbp	(revision 536)
@@ -60,4 +60,6 @@
 Const _FuncName_SendDlgItemMessage = "SendDlgItemMessageW"
 Const _FuncName_SendMessage = "SendMessageW"
+Const _FuncName_SendMessageCallback = "SendMessageCallbackW"
+Const _FuncName_SendMessageTimeout = "SendMessageTimeoutW"
 Const _FuncName_SendNotifyMessage = "SendNotifyMessageW"
 Const _FuncName_SetDlgItemText = "SetDlgItemTextW"
@@ -137,4 +139,6 @@
 Const _FuncName_SendDlgItemMessage = "SendDlgItemMessageA"
 Const _FuncName_SendMessage = "SendMessageA"
+Const _FuncName_SendMessageCallback = "SendMessageCallbackA"
+Const _FuncName_SendMessageTimeout = "SendMessageTimeoutA"
 Const _FuncName_SendNotifyMessage = "SendNotifyMessageA"
 Const _FuncName_SetDlgItemText = "SetDlgItemTextA"
@@ -1194,4 +1198,5 @@
 Const MB_YESNO =                  &H00000004
 Const MB_RETRYCANCEL =            &H00000005
+Const MB_CANCELTRYCONTINUE =      &H00000006
 Const MB_ICONHAND =               &H00000010
 Const MB_ICONQUESTION =           &H00000020
@@ -1218,4 +1223,10 @@
 Const MB_RTLREADING =             &H00100000
 Const MB_SERVICE_NOTIFICATION =   &H00200000
+
+Const MB_TYPEMASK = &h0000000F
+Const MB_ICONMASK = &h000000F0
+Const MB_DEFMASK  = &h00000F00
+Const MB_MODEMASK = &h00003000
+Const MB_MISCMASK = &h0000C000
 #ifdef UNICODE
 Declare Function MessageBox Lib "user32" Alias "MessageBoxW" (hwnd As HWND, pText As PCWSTR, pCaption As PCWSTR, uType As DWord) As Long
@@ -1290,4 +1301,17 @@
 Declare Function SendDlgItemMessage Lib "user32" Alias _FuncName_SendDlgItemMessage (hDlg As HWND, nIDDlgItem As Long, Msg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
 Declare Function SendMessage Lib "user32" Alias _FuncName_SendMessage (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
+
+TypeDef SENDASYNCPROC = *Sub(hwnd As HWND, uMsg As DWord, dwData As ULONG_PTR, lResult As LRESULT)
+Declare Function SendMessageCallback Lib "user32" Alias _FuncName_SendMessageCallback (hWnd As HWND, Msg As DWord, wParam As WPARAM, lParam As LPARAM, lpResultCallBack As SENDASYNCPROC, dwData As ULONG_PTR) As BOOL
+Const SMTO_NORMAL = &h0000
+Const SMTO_BLOCK = &h0001
+Const SMTO_ABORTIFHUNG = &h0002
+'#if WINVER >= &h0500
+'Const SMTO_NOTIMEOUTIFNOTHUNG = &h0008
+'#endif
+'#if WINVER >= &h0600
+'Const SMTO_ERRORONEXIT = &h0020
+'#endif
+Declare Function SendMessageTimeout Lib "user32" Alias _FuncName_SendMessageTimeout (hWnd As HWND, Msg As DWord, wParam As WPARAM, lParam As LPARAM, fuFlags As DWord, uTimeout As DWord, ByRef dwResult As ULONG_PTR) As LRESULT
 Declare Function SendNotifyMessage Lib "user32" Alias _FuncName_SendNotifyMessage (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
 Declare Function SetActiveWindow Lib "user32" (hWnd As HWND) As HWND
@@ -1825,5 +1849,5 @@
 #endif
 
-/*#ifdef(WINVER >= 0x0500)
+/*#ifdef(WINVER >= &h0500)
 Declare Function EnumDisplaySettingsExA Lib "user32" (ByVal lpszDeviceName As LPCSTR, ByVal iModeNum As DWord, ByVal lpDevMode As *DEVMODEA, ByVal dwFlags As DWord) As BOOL
 Declare Function EnumDisplaySettingsExW Lib "user32" (ByVal lpszDeviceName As LPCWSTR, ByVal iModeNum As DWord, ByVal lpDevMode As *DEVMODEW, ByVal dwFlags As DWord) As BOOL
@@ -1843,5 +1867,5 @@
 Declare Function EnumDisplayDevices Lib "user32" Alias _FuncName_EnumDisplayDevices (ByVal lpDevice As LPCSTR, ByVal iDevNum As DWord, ByVal lpDisplayDevice As *DISPLAY_DEVICEA, ByVal dwFlags As DWord) As BOOL
 #endif
-#endif */ /* WINVER >= 0x0500 */
+#endif */ /* WINVER >= &h0500 */
 #endif ' _INC_GDI
 
Index: trunk/ab5.0/ablib/src/basic/function.sbp
===================================================================
--- trunk/ab5.0/ablib/src/basic/function.sbp	(revision 535)
+++ trunk/ab5.0/ablib/src/basic/function.sbp	(revision 536)
@@ -588,4 +588,8 @@
 		Return "False"
 	End If
+End Function
+
+Function Str$(s As String) As String
+	Str$ = s
 End Function
 
Index: trunk/ab5.0/ablib/src/ole2.ab
===================================================================
--- trunk/ab5.0/ablib/src/ole2.ab	(revision 535)
+++ trunk/ab5.0/ablib/src/ole2.ab	(revision 536)
@@ -5,5 +5,5 @@
 #require <objbase.sbp>
 #require <oleauto.ab>
-#ifdef __UNDEFINED '#165が解決するまでの暫定
+
 ' View OBJECT Error Codes
 
@@ -53,10 +53,10 @@
 
 /* helper functions */
-Declare Function ReadClassStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef clsid As CLSID) As HRESULT
-Declare Function WriteClassStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ ByRef clsid As CLSID) As HRESULT
-Declare Function ReadClassStm Lib "ole32.dll" (/*IN*/ ByVal stm As IStream, /*OUT*/ ByRef clsid As CLSID) As HRESULT
-Declare Function WriteClassStm Lib "ole32.dll" (/*IN*/ ByVal stm As IStream, /*IN*/ ByRef clsid As CLSID) As HRESULT
-Declare Function WriteFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ ByVal cf As CLIPFORMAT, /*IN*/ ByVal pszUserType As *OLECHAR) As HRESULT
-Declare Function ReadFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef cf As CLIPFORMAT, /*OUT*/ ByRef rpszUserType As *OLECHAR) As HRESULT
+Declare Function ReadClassStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef clsid As CLSID) As HRESULT
+Declare Function WriteClassStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*IN*/ ByRef clsid As CLSID) As HRESULT
+Declare Function ReadClassStm Lib "ole32.dll" (/*IN*/ ByVal pStm As *IStream, /*OUT*/ ByRef clsid As CLSID) As HRESULT
+Declare Function WriteClassStm Lib "ole32.dll" (/*IN*/ ByVal pStm As *IStream, /*IN*/ ByRef clsid As CLSID) As HRESULT
+Declare Function WriteFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal pstg As *IStorage, /*IN*/ ByVal cf As CLIPFORMAT, /*IN*/ ByVal pszUserType As *OLECHAR) As HRESULT
+Declare Function ReadFmtUserTypeStg Lib "ole32.dll" (/*IN*/ ByVal pstg As *IStorage, /*OUT*/ ByRef cf As CLIPFORMAT, /*OUT*/ ByRef rpszUserType As *OLECHAR) As HRESULT
 
 
@@ -70,104 +70,104 @@
    the data object */
 
-Declare Function OleQueryLinkFromData Lib "ole32" (/*IN*/ ByVal srcDataObject As IDataObject) As HRESULT
-Declare Function OleQueryCreateFromData Lib "ole32.dll" (/*IN*/ ByVal srcDataObject As IDataObject) As HRESULT
+Declare Function OleQueryLinkFromData Lib "ole32" (/*IN*/ ByVal pSrcDataObject As *IDataObject) As HRESULT
+Declare Function OleQueryCreateFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObject As *IDataObject) As HRESULT
 
 
 /* Object creation APIs */
 
-Declare Function OleCreate Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByRef riid As IID, /*IN*/ ByVal renderopt As DWord,
-	/*IN*/ ByVal pFormatEtc As *FORMATETC, /*IN*/ ByVal clientSite As IOleClientSite,
-	/*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+Declare Function OleCreate Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByRef riid As IID, /*IN*/ ByVal renderopt As DWord, _
+                /*IN*/ ByVal pFormatEtc As *FORMATETC, /*IN*/ ByVal pClientSite As *IOleClientSite, _
+                /*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
 
 Declare Function OleCreateEx Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByRef riid As IID, /*IN*/ ByVal dwFlags As DWord,
-	/*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
-	/*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
-	/*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
-	/*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
-
-Declare Function OleCreateFromData Lib "ole32.dll" (/*IN*/ ByVal srcDataObj As IDataObject, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
-	/*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByVal stg As IStorage,
-	/*OUT*/ ByRef ppvObj As Any) As HRESULT
-
-Declare Function OleCreateFromDataEx Lib "ole32.dll" (/*IN*/ ByVal srcDataObj As IDataObject, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
-	/*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
-	/*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
-	/*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
-
-Declare Function OleCreateLinkFromData Lib "ole32.dll" (/*IN*/ ByVal srcDataObj As IDataObject, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
-	/*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByVal stg As IStorage,
-	/*OUT*/ ByRef ppvObj As Any) As HRESULT
-
-Declare Function OleCreateLinkFromDataEx Lib "ole32.dll" (/*IN*/ ByVal srcDataObj As IDataObject, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
-	/*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
-	/*OUT IN*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
-	/*IN*/ ByVal stg As IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
-
-Declare Function OleCreateStaticFromData Lib "ole32.dll" (/*IN*/ ByVal srcDataObj As IDataObject, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
-	/*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByVal stg As IStorage,
-	/*OUT*/ ByRef ppvObj As Any) As HRESULT
-
-
-Declare Function OleCreateLink Lib "ole32.dll" (/*IN*/ ByVal mkLinkSrc As IMoniker, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
-	/*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByVal dataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
-
-Declare Function OleCreateLinkEx Lib "ole32.dll" (/*IN*/ ByVal mkLinkSrc As IMoniker, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
-	/*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
-	/*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
-	/*IN*/ ByVal dataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+                /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
+                /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
+                /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
+                /*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+
+Declare Function OleCreateFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,
+                /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
+                /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pStg As *IStorage,
+                /*OUT*/ ByRef ppvObj As Any) As HRESULT
+
+Declare Function OleCreateFromDataEx Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,
+                /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
+                /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
+                /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
+                /*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+
+Declare Function OleCreateLinkFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,
+                /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
+                /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pStg As *IStorage,
+                /*OUT*/ ByRef ppvObj As Any) As HRESULT
+
+Declare Function OleCreateLinkFromDataEx Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,
+                /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
+                /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
+                /*OUT IN*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
+                /*IN*/ ByVal pStg As *IStorage, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+
+Declare Function OleCreateStaticFromData Lib "ole32.dll" (/*IN*/ ByVal pSrcDataObj As *IDataObject, /*IN*/ ByRef riid As IID,
+                /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
+                /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pStg As *IStorage,
+                /*OUT*/ ByRef ppvObj As Any) As HRESULT
+
+
+Declare Function OleCreateLink Lib "ole32.dll" (/*IN*/ ByVal pmkLinkSrc As *IMoniker, /*IN*/ ByRef riid As IID,
+            /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
+            /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+
+Declare Function OleCreateLinkEx Lib "ole32.dll" (/*IN*/ ByVal pmkLinkSrc As *IMoniker, /*IN*/ ByRef riid As IID,
+            /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
+            /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
+            /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
+            /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
 
 Declare Function OleCreateLinkToFile Lib "ole32.dll" (/*IN*/ ByVal lpszFileName As LPCOLESTR, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
-	/*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByValdataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+            /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
+            /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
 
 Declare Function OleCreateLinkToFileEx Lib "ole32.dll" (/*IN*/ ByVal lpszFileName As LPCOLESTR, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
-	/*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
-	/*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
-	/*IN*/ ByVal dataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+            /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
+            /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
+            /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
+            /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
 
 Declare Function OleCreateFromFile Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal lpszFileName As LPOLESTR, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
-	/*IN*/ ByVal clientSite As IOleClientSite, /*IN*/ ByVal dataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+            /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal pFormatEtc As *FORMATETC,
+            /*IN*/ ByVal pClientSite As *IOleClientSite, /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
 
 Declare Function OleCreateFromFileEx Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal lpszFileName As LPOLESTR, /*IN*/ ByRef riid As IID,
-	/*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
-	/*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal adviseSink As IAdviseSink,
-	/*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal clientSite As IOleClientSite,
-	/*IN*/ ByVal dataObj As IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
-
-Declare Function OleLoad Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ ByRef riid As IID, /*IN*/ ByVal clientSite As IOleClientSite,
-	/*OUT*/ ByRef ppvObj As Any) As HRESULT
-
-Declare Function OleSave Lib "ole32.dll" (/*IN*/ ByVal ps As IPersistStorage, /*IN*/ ByVal stg As IStorage, /*IN*/ fSameAsLoad As BOOL) As HRESULT
-
-Declare Function OleLoadFromStream Lib "ole32.dll" ( /*IN*/ ByVal stm As IStream, /*IN*/ ByRef iidInterface As IID, /*OUT*/ ByRef ppvObj As Any) As HRESULT
-Declare Function OleSaveToStream Lib "ole32.dll" ( /*IN*/ ByVal pstm As IPersistStream, /*IN*/ ByVal stm As IStream) As HRESULT
-
-
-Declare Function OleSetContainedObject Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT
-Declare Function OleNoteObjectVisible Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT
+            /*IN*/ ByVal dwFlags As DWord, /*IN*/ ByVal renderopt As DWord, /*IN*/ ByVal cFormats As DWord, /*IN*/ ByVal rgAdvf As *DWord,
+            /*IN*/ ByVal rgFormatEtc As *FORMATETC, /*IN*/ ByVal pAdviseSink As *IAdviseSink,
+            /*OUT*/ ByVal rgdwConnection As *DWord, /*IN*/ ByVal pClientSite As *IOleClientSite,
+            /*IN*/ ByVal pDataObj As *IDataObject, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+
+Declare Function OleLoad Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*IN*/ ByRef riid As IID, /*IN*/ ByVal pClientSite As *IOleClientSite,
+            /*OUT*/ ByRef ppvObj As Any) As HRESULT
+
+Declare Function OleSave Lib "ole32.dll" (/*IN*/ ByVal pPS As *IPersistStorage, /*IN*/ ByVal pStg As *IStorage, /*IN*/ fSameAsLoad As BOOL) As HRESULT
+
+Declare Function OleLoadFromStream Lib "ole32.dll" ( /*IN*/ ByVal pStm As *IStream, /*IN*/ ByRef iidInterface As IID, /*OUT*/ ByRef ppvObj As Any) As HRESULT
+Declare Function OleSaveToStream Lib "ole32.dll" ( /*IN*/ ByVal pPStm As *IPersistStream, /*IN*/ ByVal pStm As *IStream) As HRESULT
+
+
+Declare Function OleSetContainedObject Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT
+Declare Function OleNoteObjectVisible Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal fContained As BOOL) As HRESULT
 
 
 /* Drag/Drop APIs */
 
-Declare Function RegisterDragDrop Lib "ole32.dll" (/*IN*/ ByVal hwnd As HWND, /*IN*/ ByVal dropTarget As IDropTarget) As HRESULT
+Declare Function RegisterDragDrop Lib "ole32.dll" (/*IN*/ ByVal hwnd As HWND, /*IN*/ ByVal pDropTarget As *IDropTarget) As HRESULT
 Declare Function RevokeDragDrop Lib "ole32.dll" (/*IN*/ ByVal hwnd As HWND) As HRESULT
-Declare Function DoDragDrop Lib "ole32.dll" (/*IN*/ ByVal dataObj As IDataObject, /*IN*/ ByVal dropSource As IDropSource,
-	/*IN*/ ByVal dwOKEffects As DWord, /*OUT*/ ByRef dwEffect As DWord) As HRESULT
+Declare Function DoDragDrop Lib "ole32.dll" (/*IN*/ ByVal pDataObj As *IDataObject, /*IN*/ ByVal pDropSource As *IDropSource,
+            /*IN*/ ByVal dwOKEffects As DWord, /*OUT*/ ByRef dwEffect As DWord) As HRESULT
 
 /* Clipboard APIs */
 
-Declare Function OleSetClipboard Lib "ole32.dll" (/*IN*/ ByVal dataObj As IDataObject) As HRESULT
-Declare Function OleGetClipboard Lib "ole32.dll" (/*OUT*/ ByRef dataObj As IDataObject) As HRESULT
+Declare Function OleSetClipboard Lib "ole32.dll" (/*IN*/ ByVal pDataObj As *IDataObject) As HRESULT
+Declare Function OleGetClipboard Lib "ole32.dll" (/*OUT*/ ByRef pDataObj As *IDataObject) As HRESULT
 Declare Function OleFlushClipboard Lib "ole32.dll" () As HRESULT
-Declare Function OleIsCurrentClipboard Lib "ole32.dll" (/*IN*/ ByVal dataObj As IDataObject) As HRESULT
+Declare Function OleIsCurrentClipboard Lib "ole32.dll" (/*IN*/ ByVal pDataObj As *IDataObject) As HRESULT
 
 
@@ -186,37 +186,37 @@
 End Type
 Declare Function OleCreateMenuDescriptor Lib "ole32.dll" (/*IN*/ ByVal hmenuCombined As HMENU,
-	/*IN*/ ByRef MenuWidths As OLEMENUGROUPWIDTHS) As HOLEMENU
+                                /*IN*/ ByRef MenuWidths As OLEMENUGROUPWIDTHS) As HOLEMENU
 Declare Function OleSetMenuDescriptor Lib "ole32.dll" (/*IN*/ ByVal holemenu As HOLEMENU, /*IN*/ ByVal hwndFrame As HWND,
-	/*IN*/ ByVal hwndActiveObject As HWND,
-	/*IN*/ ByVal frame As IOleInPlaceFrame,
-	/*IN*/ ByVal activeObj As IOleInPlaceActiveObject) As HRESULT
+                                /*IN*/ ByVal hwndActiveObject As HWND,
+                                /*IN*/ ByVal pFrame As *IOleInPlaceFrame,
+                                /*IN*/ ByVal pActiveObj As *IOleInPlaceActiveObject) As HRESULT
 Declare Function OleDestroyMenuDescriptor Lib "ole32.dll" (/*IN*/ ByVal holemenu As HOLEMENU) As HRESULT
 
-Declare Function OleTranslateAccelerator Lib "ole32.dll" (/*IN*/ ByVal frame As IOleInPlaceFrame,
-	/*IN*/ ByRef FrameInfo As OLEINPLACEFRAMEINFO, /*IN*/ ByRef msg As MSG) As HRESULT
+Declare Function OleTranslateAccelerator Lib "ole32.dll" (/*IN*/ ByVal pFrame As *IOleInPlaceFrame,
+                            /*IN*/ ByRef FrameInfo As OLEINPLACEFRAMEINFO, /*IN*/ ByRef msg As MSG) As HRESULT
 
 
 /* Helper APIs */
 Declare Function OleDuplicateData Lib "ole32.dll" (/*IN*/ ByVal hSrc As HANDLE, /*IN*/ ByVal cfFormat As CLIPFORMAT,
-	/*IN*/ ByVal uiFlags As DWord) As HANDLE
-
-Declare Function OleDraw Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal dwAspect As DWord, /*IN*/ ByVal hdcDraw As HDC,
-	/*IN*/ ByRef rcBounds As RECT) As HRESULT
-
-Declare Function OleRun Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown) As HRESULT
-Declare Function OleIsRunning Lib "ole32.dll" (/*IN*/ ByVal object As IOleObject) As BOOL
-Declare Function OleLockRunning Lib "ole32.dll" (/*IN*/ ByVal unknown As IUnknown, /*IN*/ ByVal fLock As BOOL, /*IN*/ ByVal fLastUnlockCloses As BOOL) As HRESULT
+                        /*IN*/ ByVal uiFlags As DWord) As HANDLE
+
+Declare Function OleDraw Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal dwAspect As DWord, /*IN*/ ByVal hdcDraw As HDC,
+                    /*IN*/ ByRef rcBounds As RECT) As HRESULT
+
+Declare Function OleRun Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown) As HRESULT
+Declare Function OleIsRunning Lib "ole32.dll" (/*IN*/ ByVal pObject As *IOleObject) As BOOL
+Declare Function OleLockRunning Lib "ole32.dll" (/*IN*/ ByVal pUnknown As *IUnknown, /*IN*/ ByVal fLock As BOOL, /*IN*/ ByVal fLastUnlockCloses As BOOL) As HRESULT
 Declare Sub      ReleaseStgMedium Lib "ole32.dll" (/*IN*/ ByRef medium As STGMEDIUM)
-Declare Function CreateOleAdviseHolder Lib "ole32.dll" (/*OUT*/ ByRef oaHolder As IOleAdviseHolder) As HRESULT
-
-Declare Function OleCreateDefaultHandler Lib "ole32.dll" (/*IN*/ ByRef clsid As CLSID, /*IN*/ ByVal unkOuter As IUnknown,
-	/*IN*/ ByRef riid As IID, /*OUT*/ ByRef pObj As Any) As HRESULT
-
-Declare Function OleCreateEmbeddingHelper Lib "ole32.dll" (/*IN*/ ByRef clsid As CLSID, /*IN*/ ByVal ukOuter As IUnknown,
-	/*IN*/ ByVal flags As DWord, /*IN*/ ByVal cf As IClassFactory,
-	/*IN*/ ByRef riid As IID, /*OUT*/ ByRef pObj As Any) As HRESULT
+Declare Function CreateOleAdviseHolder Lib "ole32.dll" (/*OUT*/ ByRef pOAHolder As *IOleAdviseHolder) As HRESULT
+
+Declare Function OleCreateDefaultHandler Lib "ole32.dll" (/*IN*/ ByRef clsid As CLSID, /*IN*/ ByVal pUnkOuter As *IUnknown,
+                    /*IN*/ ByRef riid As IID, /*OUT*/ ByRef pObj As Any) As HRESULT
+
+Declare Function OleCreateEmbeddingHelper Lib "ole32.dll" (/*IN*/ ByRef clsid As CLSID, /*IN*/ ByVal pUnkOuter As *IUnknown,
+                    /*IN*/ ByVal flags As DWord, /*IN*/ ByVal pCF As *IClassFactory,
+                    /*IN*/ ByRef riid As IID, /*OUT*/ ByRef pObj As Any) As HRESULT
 
 Declare Function IsAccelerator Lib "ole32.dll" (/*IN*/ ByVal hAccel As HACCEL, /*IN*/ ByVal cAccelEntries As Long, /*IN*/ ByRef msg As MSG,
-	/*OUT*/ ByVal pwCmd As *Word) As BOOL
+                                        /*OUT*/ ByVal pwCmd As *Word) As BOOL
 /* Icon extraction Helper APIs */
 
@@ -224,8 +224,8 @@
 
 Declare Function OleGetIconOfClass Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal lpszLabel As LPOLESTR,
-	/*IN*/ ByVal fUseTypeAsLabel As BOOL) As HGLOBAL
+                                        /*IN*/ ByVal fUseTypeAsLabel As BOOL) As HGLOBAL
 
 Declare Function OleMetafilePictFromIconAndLabel Lib "ole32.dll" (/*IN*/ ByVal hIcon As HICON, /*IN*/ ByVal lpszLabel As LPOLESTR,
-	/*IN*/ ByVal lpszSourceFile As LPOLESTR, /*IN*/ ByVal iIconIndex As DWord) As HGLOBAL
+                                        /*IN*/ ByVal lpszSourceFile As LPOLESTR, /*IN*/ ByVal iIconIndex As DWord) As HGLOBAL
 
 
@@ -234,11 +234,11 @@
 
 Declare Function OleRegGetUserType Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal dwFormOfType As DWord,
-	/*OUT*/ ByVal pszUserType As LPOLESTR) As HRESULT
+                                        /*OUT*/ ByVal pszUserType As LPOLESTR) As HRESULT
 
 Declare Function OleRegGetMiscStatus Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal dwAspect As DWord,
-	/*OUT*/ ByRef dwStatus As DWord) As HRESULT
+                                        /*OUT*/ ByRef dwStatus As DWord) As HRESULT
 
 Declare Function OleRegEnumFormatEtc Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*IN*/ ByVal dwDirection As DWord,
-	/*OUT*/ ByRef penum As *IEnumFORMATETC) As HRESULT
+                                        /*OUT*/ ByRef penum As *IEnumFORMATETC) As HRESULT
 
 Declare Function OleRegEnumVerbs Lib "ole32.dll" (/*IN*/ ByRef rclsid As CLSID, /*OUT*/ ByRef penum As *IEnumOLEVERB) As HRESULT
@@ -256,12 +256,12 @@
 
 
-Declare Function OleConvertOLESTREAMToIStorage Lib "ole32.dll" (
-	/*IN*/ ByVal lpolestream As LPOLESTREAM,
-	/*OUT*/ ByVal stg As IStorage,
-	/*IN*/ ByRef td As DVTARGETDEVICE) As HRESULT
-
-Declare Function OleConvertIStorageToOLESTREAM Lib "ole32.dll" (
-	/*IN*/ ByVal stg As IStorage,
-	/*OUT*/ ByVal lpolestream As LPOLESTREAM) As HRESULT
+Declare Function OleConvertOLESTREAMToIStorage Lib "ole32.dll" ( _
+    /*IN*/ ByVal lpolestream As LPOLESTREAM,
+    /*OUT*/ ByVal pstg As *IStorage,
+    /*IN*/ ByRef td As DVTARGETDEVICE) As HRESULT
+
+Declare Function OleConvertIStorageToOLESTREAM Lib "ole32.dll" ( _
+    /*IN*/ ByVal pstg As *IStorage,
+    /*OUT*/ ByVal lpolestream As LPOLESTREAM) As HRESULT
 
 
@@ -269,39 +269,38 @@
 Declare Function GetHGlobalFromILockBytes Lib "ole32.dll" (/*IN*/ ByVal plkbyt As *ILockBytes, /*OUT*/ ByRef hglobal As HGLOBAL) As HRESULT
 Declare Function CreateILockBytesOnHGlobal Lib "ole32.dll" (/*IN*/ ByVal hGlobal As HGLOBAL, /*IN*/ ByVal fDeleteOnRelease As BOOL,
-	/*OUT*/ ByRef lkbyt As ILockBytes) As HRESULT
+                                    /*OUT*/ ByRef pplkbyt As *ILockBytes) As HRESULT
 
 Declare Function GetHGlobalFromStream Lib "ole32.dll" (/*IN*/ ByVal pstm As *IStream, /*OUT*/ ByRef hglobal As HGLOBAL) As HRESULT
 Declare Function CreateStreamOnHGlobal Lib "ole32.dll" (/*IN*/ ByVal hGlobal As HGLOBAL, /*IN*/ ByVal fDeleteOnRelease As BOOL,
-	/*OUT*/ ByRef stm As IStream) As HRESULT
+                                /*OUT*/ ByRef pstm As *IStream) As HRESULT
 
 
 /* ConvertTo APIS */
 
-Declare Function OleDoAutoConvert Lib "ole32.dll" (/*IN*/ ByRef stg As IStorage, /*OUT*/ ByRef ClsidNew As CLSID) As HRESULT
+Declare Function OleDoAutoConvert Lib "ole32.dll" (/*IN*/ ByRef pStg As *IStorage, /*OUT*/ ByRef ClsidNew As CLSID) As HRESULT
 Declare Function OleGetAutoConvert Lib "ole32.dll" (/*IN*/ ByRef clsidOld As CLSID, /*OUT*/ ByRef ClsidNew As CLSID) As HRESULT
 Declare Function OleSetAutoConvert Lib "ole32.dll" (/*IN*/ ByRef clsidOld As CLSID, /*IN*/ ByRef ClsidNew As CLSID) As HRESULT
-Declare Function GetConvertStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage) As HRESULT
-Declare Function SetConvertStg Lib "ole32.dll" (/*IN*/ ByVal stg As IStorage, /*IN*/ fConvert As BOOL) As HRESULT
+Declare Function GetConvertStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage) As HRESULT
+Declare Function SetConvertStg Lib "ole32.dll" (/*IN*/ ByVal pStg As *IStorage, /*IN*/ fConvert As BOOL) As HRESULT
 
 
 Declare Function OleConvertIStorageToOLESTREAMEx Lib "ole32.dll" ( _
-	/*IN*/ ByVal stg As IStorage,       ' Presentation data to OLESTREAM
-	/*IN*/ ByVal cfFormat As CLIPFORMAT,  '       format
-	/*IN*/ ByVal lWidth As Long,          '       width
-	/*IN*/ ByVal lHeight As Long,         '       height
-	/*IN*/ ByVal dwSize As DWORD,         '       size in bytes
-	/*IN*/ ByRef medium As STGMEDIUM,     '       bits
-	/*OUT*/ ByVal polestm As LPOLESTREAM) As HRESULT
+    /*IN*/ ByVal pstg As *IStorage,       ' Presentation data to OLESTREAM
+    /*IN*/ ByVal cfFormat As CLIPFORMAT,  '       format
+    /*IN*/ ByVal lWidth As Long,          '       width
+    /*IN*/ ByVal lHeight As Long,         '       height
+    /*IN*/ ByVal dwSize As DWORD,         '       size in bytes
+    /*IN*/ ByRef medium As STGMEDIUM,     '       bits
+    /*OUT*/ ByVal polestm As LPOLESTREAM) As HRESULT
 
 Declare Function OleConvertOLESTREAMToIStorageEx Lib "ole32.dll" ( _
-	/*IN*/ ByVal polestm As LPOLESTREAM,
-	/*OUT*/ ByVal pstg As *IStorage,' Presentation data from OLESTREAM
-	/*OUT*/ ByRef pcfFormat As CLIPFORMAT, '       format
-	/*OUT*/ ByRef plwWidth As Long,        '       width
-	/*OUT*/ ByRef plHeight As Long,        '       height
-	/*OUT*/ ByRef pdwSize As DWord,        '       size in bytes
-	/*OUT*/ ByRef medium As STGMEDIUM) As HRESULT   '      bits
+    /*IN*/ ByVal polestm As LPOLESTREAM,
+    /*OUT*/ ByVal pstg As *IStorage,' Presentation data from OLESTREAM
+    /*OUT*/ ByRef pcfFormat As CLIPFORMAT, '       format
+    /*OUT*/ ByRef plwWidth As Long,        '       width
+    /*OUT*/ ByRef plHeight As Long,        '       height
+    /*OUT*/ ByRef pdwSize As DWord,        '       size in bytes
+    /*OUT*/ ByRef medium As STGMEDIUM) As HRESULT   '      bits
 
 ' olectl.h
-Declare Function OleLoadPicture Lib "olepro32" (stream As IStream, lSize As Long, fRunmode As BOOL, ByRef riid As IID, ppvObj As VoidPtr) As HRESULT
-#endif '__UNDEFINED
+Declare Function OleLoadPicture Lib "olepro32" (pStream As *IStream, lSize As Long, fRunmode As BOOL, ByRef riid As IID, ppvObj As VoidPtr) As HRESULT
