Home COM GDI+ WebBrowser Data Access 

COM Fundamentals

 

Functions

 

BindMoniker

CLSIDFromProgID

CLSIDFromProgIDEx

CLSIDFromString

CoAddRefServerProcess

CoAllowSetForegroundWindow

CoBuildVersion

CoCancelCall

CoCopyProxy

CoCreateFreeThreadedMarshaler

CoCreateGuid

CoCreateInstance

CoCreateInstanceEx

CoCreateStandardMalloc

CoDisableCallCancellation

CoDisconnectObject

CoDosDateTimeToFileTime

CoEnableCallCancellation

CoFileTimeNow

CoFileTimeToDosDateTime

CoFreeAllLibraries

CoFreeLibrary

CoFreeUnusedLibraries

CoFreeUnusedLibrariesEx

CoGetCallContext

CoGetCallerTID

CoGetCancelObject

CoGetClassObject

CoGetContextToken

CoGetCurrentProcess

CoGetInstanceFromFile

CoGetInstanceFromIStorage

CoGetInterceptor

CoGetInterfaceAndReleaseStream

CoGetMalloc

CoGetMarshalSizeMax

CoGetObject

CoGetObjectContext

CoGetPSClsid

CoGetStandardMarshal

CoGetStdMarshalEx

CoGetTreatAsClass

CoImpersonateClient

CoInitialize

CoInitializeEx

CoInitializeSecutiry

CoInstall

CoInvalidateRemotemachineBindings

CoIsHandlerConnected

CoIsOle1Class

CoLoadLibrary

CoLockObjectExternal

CoMarshalHresult

CoMarshalInterface

CoMarshalInterThreadInterfaceInStream

CoQueryAuthenticationServices

CoQueryClientBlanket

CoQueryProxyBlanket

CoRegisterClassObject

CoRegisterInitializeSpy

CoRegisterMallocSpy

CoRegisterMessageFilter

CoRegisterPSClsid

CoRegisterSurrogate

CoRegisterSurrogateEx

CoReleaseMarshalData

CoReleaseServerProcess

CoResumeClassObjects

CoRevertToSelf

CoRevokeClassObject

 

 

CoRevokeInitializeSpy

CoRevokeMallocSpy

CoSetCancelObject

CoSetProxyBlanket

CoSuspendClassObjects

CoSwitchCallContext

CoTaskMemAlloc

CoTaskMemFree

CoTaskMemRealloc

CoTestCancel

CoTreatAsClass

CoUninitialize

CoUnmarshalHresult

CoUnmarshalInterface

CoWaitForMultipleHandles

CreateAntiMoniker

CreateAsyncBindCtx

CreateBindCtx

CreateClassMoniker

CreateFileMoniker

CreateGenericComposite

CreateItemMoniker

CreateObjrefMoniker

CreatePointerMoniker

DllCanUnloadNow

DllGetClassObject

DllRegisterServer

DllUnregisterServer

FAILED

GetClassFile

GetRunningObjectTable

GetScode (obsolete)

HRESULT_CODE

HRESULT_FACILITY

HRESULT_FROM_NT

HRESULT_FROM_WIN32

HRESULT_SEVERITY

IIDFromString

IsAccelerator

IS_ERROR

IsEqualGUID

IsEqualCLSID

IsEqualIID

IsValidIid (obsolete)

IsValidInterface (obsolete)

IsValidPtrIn (obsolete)

IsValidPtrOut (obsolete)

MAKE_HRESULT

MAKE_SCODE

MkParseDisplayName

MonikerCommonPrefixWith

MonikerRelativePathTo

OleDoAutoConvert

OleGetAutoConvert

OleGetIconOfClass

OleGetIconOfFile

OleIconToCursor

OleRegGetMiscStatus

OleRecGetUserType

OleSetAutoConvert

ProgIDFromCLSID

PropagateResult (obsolete)

ResultFromScode (obsolete)

SCODE_CODE

SCODE_FACILITY

SCODE_SEVERITY

StringFromCLSID

StringFromGUID2

StrinfFromIID

SUCCEEDED

 

 

BindMoniker

 

Locates an object by means of its moniker, activates the object if it is inactive, and retrieves a pointer to the specified interface on that object.
 

 

DECLARE FUNCTION BindMoniker _

   LIB "OLE32.DLL" _

   ALIAS "BindMoniker" ( _

   BYVAL pmk AS DWORD, _

   BYVAL grfOpt AS DWORD, _

   BYREF iidResult AS GUID, _

   BYREF ppvResult AS DWORD _

) AS LONG
 

 

CLSIDFromProgID

 

Looks up a CLSID in the registry, given a ProgID.
 

 

' Use: DIM hr AS DWORD, ProgID AS STRING, clsid AS GUID
' ProgID = UCODE$("Shell.Explorer.1" & $NUL)

' hr = CLSIDFromProgID(ProgID, clsid))
 

DECLARE FUNCTION CLSIDFromProgID _

   LIB "OLE32.DLL" _

   ALIAS "CLSIDFromProgID" ( _

   BYVAL lpszProgID AS STRING, _  ' Null-terminated unicode string

   BYREF pclsid AS GUID _

) AS DWORD
 

 

CLSIDFromProgIDEx

 

CLSIDFromProgIDEx triggers automatic installation if the COMClassStore Policy is enabled (analogous to the behavior of CoCreateInstance(Ex) when neither CLSCTX_ENABLE_CODE_DOWNLOAD nor CLSCTX_NO_CODE_DOWNLOAD are specified).
 

 

DECLARE FUNCTION CLSIDFromProgIDEx _

   LIB "OLE32.DLL" _

   ALIAS "CLSIDFromProgIDEx" ( _

   BYVAL lpszProgID AS STRING, _  ' Null-terminated unicode string

   BYREF pclsid AS GUID _

) AS DWORD
 

 

CLSIDFromString

 

Converts a string generated by the StringFromCLSID function back into the original CLSID.
 

 

DECLARE FUNCTION CLSIDFromString _

   LIB "OLE32.DLL" _

   ALIAS "CLSIDFromString" ( _

   BYVAL lpsz AS STRING, _  ' Null-terminated unicode string

   BYREF pclsid AS GUID _

) AS DWORD
 

 

CoAddRefServerProcess

 

Increments a global per-process reference count.
 

 

DECLARE FUNCTION CoAddRefServerProcess _

   LIB "OLE32.DLL" _

   ALIAS "CoAddRefServerProcess" ( _

) AS DWORD
 

 

CoAllowSetForegroundWindow

 

The system restricts which processes can call the SetForegroundWindow function and AllowSetForegroundWindow to set the foreground window. As a result, an application is blocked from stealing the focus from another application even when the user is interacting with it. The CoAllowSetForegroundWindow function enables the COM server process called to take focus away from the client application by using the IForegroundTransfer interface. The COM client then yields the foreground window to the specified COM server process whose proxy is pUnk. Yielding the foreground window is useful when the client wants a window owned by the server process to take focus.
 

 

DECLARE FUNCTION CoAllowSetForegroundWindow _

   LIB "OLE32.DLL" _

   ALIAS "CoAllowSetForegroundWindow" ( _

   BYVAL punk AS DWORD, _

   BYVAL lpvReserved AS DWORD _

) AS LONG
 

 

CoBuildVersion

 

This function is obsolete.
 

 

DECLARE FUNCTION CoBuildVersion _

   LIB "OLE32.DLL" _

   ALIAS "CoBuildVersion" ( _

) AS DWORD
 

 

CoCancelCall

 

Requests cancellation of an outbound DCOM method call pending on a specified thread.
 

 

DECLARE FUNCTION CoCancelCall _

   LIB "OLE32.DLL" _

   ALIAS "CoCancelCall" ( _

   BYVAL dwThreadID AS DWORD, _

   BYVAL ulTimeOut AS DWORD _

) AS LONG
 

 

CoCopyProxy

 

Makes a private copy of the specified proxy.
 

 

DECLARE FUNCTION CoCopyProxy _

   LIB "OLE32.DLL" _

   ALIAS "CoCopyProxy" ( _

   BYVAL pProxy AS DWORD, _

   BYREF ppCopy AS DWORD _

) AS LONG
 

 

CoCreateFreeThreadedMarshaler

 

Creates an aggregatable object capable of context-dependent marshaling.
 

 

DECLARE FUNCTION CoCreateFreeThreadedMarshaler _

   LIB "OLE32.DLL" _

   ALIAS "CoCreateFreeThreadedMarshaler" ( _

   BYVAL punkOuter AS DWORD, _

   BYREF ppunkMarshaler AS DWORD _

) AS LONG
 

 

CoCreateGuid

 

Creates a GUID, a unique 128-bit integer used for CLSIDs and interface identifiers.
 

 

DECLARE FUNCTION CoCreateGuid _

   LIB "OLE32.DLL" _

   ALIAS "CoCreateGuid" ( _

   BYREF pGuid AS GUID _

) AS LONG
 

 

CoCreateInstance

 

Creates a single uninitialized object of the class associated with a specified CLSID. Call CoCreateInstance when you want to create only one object on the local system. To create a single object on a remote system, call CoCreateInstanceEx. To create multiple objects based on a single CLSID, refer to the CoGetClassObject function.
 

 

DECLARE FUNCTION CoCreateInstance _

   LIB "OLE32.DLL" _

   ALIAS "CoCreateInstance" ( _

   BYREF rclsid AS GUID, _

   BYREF pUnkOuter AS ANY, _

   BYVAL dwClsContext AS DWORD, _

   BYREF riid AS GUID, _

   BYREF ppv AS DWORD _

) AS LONG
 

 

CoCreateInstanceEx

 

Creates a single uninitialized object of the class associated with a specified CLSID. Call CoCreateInstance when you want to create only one object on the local system. To create a single object on a remote system, call CoCreateInstanceEx. To create multiple objects based on a single CLSID, refer to the CoGetClassObject function.
 

 

DECLARE FUNCTION CoCreateInstanceEx _

   LIB "OLE32.DLL" _

   ALIAS "CoCreateInstanceEx" ( _

   BYREF rclsid AS GUID, _

   BYREF pUnkOuter AS ANY, _

   BYVAL dwClsContext AS DWORD, _

   BYREF pServerInfo AS COSERVERINFO, _

   BYVAL cmq AS LONG, _

   BYVAL pResults AS DWORD _

) AS LONG
 

 

CoCreateStandardMalloc

 

This function is obsolete. Refer to CoGetMalloc.
 

 

CoDisableCallCancellation

 

Converts the MS-DOS representation of the time and date to a FILETIME structure, which Win32 uses to determine the date and time.
 

 

DECLARE FUNCTION CoDisableCallCancellation _

   LIB "OLE32.DLL" _

   ALIAS "CoDisableCallCancellation" ( _

   BYVAL pReserved AS DWORD _

) AS LONG
 

 

CoDisconnectObject

 

Disconnects all remote process connections being maintained on behalf of all the interface pointers that point to a specified object. Only the process that actually manages the object should call CoDisconnectObject.
 

 

DECLARE FUNCTION CoDisconnectObject _

   LIB "OLE32.DLL" _

   ALIAS "CoDisconnectObject" ( _

   BYVAL pUnk AS DWORD, _

   BYVAL dwReserved AS DWORD _

) AS LONG
 

 

CoDosDateTimeToFileTime

 

Converts the MS-DOS representation of the time and date to a FILETIME structure, which Win32 uses to determine the date and time.
 

 

DECLARE FUNCTION CoDosDateTimeToFileTime _

   LIB "OLE32.DLL" _

   ALIAS "CoDosDateTimeToFileTime" ( _

   BYVAL nDosDate AS WORD, _

   BYVAL nDosTime AS WORD, _

   BYREF lpFileTime AS FILETIME _

) AS LONG
 

 

CoEnableCallCancellation

 

Enables cancellation of synchronous calls on the calling thread.
 

 

DECLARE FUNCTION CoEnableCallCancellation _

   LIB "OLE32.DLL" _

   ALIAS "CoEnableCallCancellation" ( _

   BYVAL pvReserved AS DWORD _

) AS LONG
 

 

CoFileTimeNow

 

Returns the current time as a FILETIME structure.
 

 

DECLARE FUNCTION CoFileTimeNow _

   LIB "OLE32.DLL" _

   ALIAS "CoFileTimeNow" ( _

   BYREF lpFileTime AS FILETIME _

) AS LONG
 

 

CoFileTimeToDosDateTime

 

Returns the current time as a FILETIME structure.
 

 

DECLARE FUNCTION CoFileTimeToDosDateTime _

   LIB "OLE32.DLL" _

   ALIAS "CoFileTimeToDosDateTime" ( _

   BYREF lpFileTime AS FILETIME, _

   BYREF lpDosDate AS WORD, _

   BYREF lpDosTime AS WORD _

) AS LONG
 

 

CoFreeAllLibraries

 

Frees all the DLLs that have been loaded with the CoLoadLibrary function (called internally by CoGetClassObject), regardless of whether they are currently in use. This function is usually not called directly, because CoUninitialize and OleUninitialize call it internally.
 

 

DECLARE SUB CoFreeAllLibraries _

   LIB "OLE32.DLL" _

   ALIAS "CoFreeAllLibraries" ( _

)
 

 

CoFreeLibrary

 

Frees a library that, when loaded, was specified to be freed explicitly.
 

 

DECLARE SUB CoFreeLibrary _

   LIB "OLE32.DLL" _

   ALIAS "CoFreeLibrary" ( _

   BYVAL hInst AS DWORD _

)
 

 

CoFreeUnusedLibraries

 

Unloads any DLLs that are no longer in use and that, when loaded, were specified to be freed automatically.
 

 

DECLARE SUB CoFreeUnusedLibraries _

   LIB "OLE32.DLL" _

   ALIAS "CoFreeUnusedLibraries" ( _

)
 

 

CoFreeUnusedLibrariesEx

 

Unloads any DLLs that are no longer in use and whose unload delay has expired.
 

 

DECLARE SUB CoFreeUnusedLibrariesEx _

   LIB "OLE32.DLL" _

   ALIAS "CoFreeUnusedLibrariesEx" ( _

)
 

 

CoGetCallContext

 

Unloads any DLLs that are no longer in use and whose unload delay has expired.
 

 

DECLARE FUNCTION CoGetCallContext _

   LIB "OLE32.DLL" _

   ALIAS "CoGetCallContext" ( _

   BYREF riid AS GUID, _

   BYREF ppInterface AS DWORD _

) AS LONG
 

 

CoGetCallerTID

 

Returns a GUID identifying the callers thread.
 

 

DECLARE FUNCTION CoGetCallerTID _

   LIB "OLE32.DLL" _

   ALIAS "CoGetCallerTID" ( _

   BYREF lpdwTID AS DWORD _

) AS LONG
 

 

CoGetCancelObject

 

Obtains a pointer to a call control interface, normally ICancelMethodCalls, on the cancel object corresponding to an outbound COM method call pending on the same or another client thread.
 

 

DECLARE FUNCTION CoGetCancelObject _

   LIB "OLE32.DLL" _

   ALIAS "CoGetCancelObject" ( _

   BYVAL dwThreadID AS DWORD, _

   BYREF riid AS GUID, _

   BYREF ppUnk AS DWORD _

) AS LONG
 

 

CoGetClassObject

 

Provides a pointer to an interface on a class object associated with a specified CLSID. CoGetClassObject locates, and if necessary, dynamically loads the executable code required to do this.

 

Call CoGetClassObject directly when you want to create multiple objects through a class object for which there is a CLSID in the system registry. You can also retrieve a class object from a specific remote machine. Most class objects implement the IClassFactory interface. You would then call IClassFactory::CreateInstance to create an uninitialized object. It is not always necessary to go through this process. To create a single object, call instead the either the CoCreateInstanceEx function, which allows you to create an instance on a remote machine. This replaces the CoCreateInstance function, which can still be used to create an instance on a local machine. Both functions encapsulate connecting to the class object, creating the instance, and releasing the class object. Two other functions, CoGetInstanceFromFile and CoGetInstanceFromIStorage, provide both instance creation on a remote system, and object activation. OLE also provides many other ways to create an object in the form of numerous helper functions and interface methods whose function is to create objects of a single type and provide a pointer to an interface on that object.

 

Note The CoGetClassObject function does not call CoLoadLibrary.
 

 

DECLARE FUNCTION CoGetClassObject _

   LIB "OLE32.DLL" _

   ALIAS "CoGetClassObject" ( _

   BYREF rclsid AS GUID, _

   BYVAL dwclsContext AS DWORD, _

   BYREF pServerInfo AS COSERVERINFO, _

   BYREF riid AS GUID, _

   BYREF ppv AS DWORD _

) AS LONG
 

 

CoGetContextToken

 

Returns a pointer to an implementation of IObjContext for the current context.

 

 

DECLARE FUNCTION CoGetContextToken _

   LIB "OLE32.DLL" _

   ALIAS "CoGetContextToken" ( _

   BYREF pToken AS DWORD _

) AS LONG
 

 

CoGetCurrentProcess

 

Returns a value that is unique to the current thread. CoGetCurrentProcess can be used to avoid thread ID reuse problems.
 

 

DECLARE FUNCTION CoGetCurrentProcess _

   LIB "OLE32.DLL" _

   ALIAS "CoGetCurrentProcess" ( _

) AS DWORD
 

 

CoGetInstanceFromFile

 

Creates a new object and initializes it from a file using IPersistFile::Load.
 

 

DECLARE FUNCTION CoGetInstanceFromFile _

   LIB "OLE32.DLL" _

   ALIAS "CoGetInstanceFromFile" ( _

   BYREF pServerInfo AS COSERVERINFO, _

   BYREF pclsid AS GUID, _

   BYVAL punkPuter AS DWORD, _

   BYVAL dwClsCtx AS DWORD, _

   BYVAL grfMode AS DWORD, _

   BYVAL szName AS STRING, _  ' Null-terminated unicode string

   BYVAL cmq AS DWORD, _

   BYVAL rgmqResults AS DWORD _

) AS LONG
 

 

CoGetInstanceFromIStorage

 

Creates a new object and initializes it from a storage object through an internal call to IPersistStorage::Load.
 

 

DECLARE FUNCTION CoGetInstanceFromIStorage _

   LIB "OLE32.DLL" _

   ALIAS "CoGetInstanceFromIStorage" ( _

   BYREF pServerInfo AS COSERVERINFO, _

   BYREF pclsid AS GUID, _

   BYVAL punkPuter AS DWORD, _

   BYVAL dwClsCtx AS DWORD, _

   BYVAL pstg AS DWORD, _

   BYVAL cmq AS DWORD, _

   BYVAL rgmqResults AS DWORD _

) AS LONG
 

 

CoGetInterceptor

 

Instantiates the appropriate interceptor for the indicated interface to be intercepted and returns the newly created interceptor.
 

 

DECLARE FUNCTION CoGetInterceptor _

   LIB "OLE32.DLL" _

   ALIAS "CoGetInterceptor" ( _

   BYREF iidIntercepted AS GUID, _

   BYVAL punkOuter AS DWORD, _

   BYREF iid AS GUID, _

   BYREF ppv AS DWORD _

) AS LONG
 

 

CoGetInterfaceAndReleaseStream

 

Unmarshals a buffer containing an interface pointer and releases the stream when an interface pointer has been marshaled from another thread to the calling thread.
 

 

DECLARE FUNCTION CoGetInterfaceAndReleaseStream _

   LIB "OLE32.DLL" _

   ALIAS "CoGetInterfaceAndReleaseStream" ( _

   BYVAL pStm AS DWORD, _

   BYREF riid AS GUID, _

   BYREF ppv AS DWORD _

) AS LONG
 

 

CoGetMalloc

 

Retrieves a pointer to the default OLE task memory allocator (which supports the system implementation of the IMalloc interface) so applications can call its methods to manage memory.
 

 

DECLARE FUNCTION CoGetMalloc _

   LIB "OLE32.DLL" _

   ALIAS "CoGetMalloc" ( _

   BYVAL dwMemContext AS DWORD, _

   BYREF ppMalloc AS DWORD _

) AS LONG
 

 

CoGetMarshalSizeMax

 

Returns an upper bound on the number of bytes needed to marshal the specified interface pointer to the specified object.
 

 

DECLARE FUNCTION CoGetMarshalSizeMax _

   LIB "OLE32.DLL" _

   ALIAS "CoGetMarshalSizeMax" ( _

   BYREF pulSize AS DWORD, _

   BYREF riid AS GUID, _

   BYVAL pUnk AS DWORD, _

   BYVAL dwDestContext AS DWORD, _

   BYVAL pvDestContext AS DWORD, _

   BYVAL mshlflags AS DWORD _

) AS LONG
 

 

CoGetObject

 

Converts a display name into a moniker that identifies the object named, and then binds to the object identified by the moniker.
 

 

DECLARE FUNCTION CoGetObject _

   LIB "OLE32.DLL" _

   ALIAS "CoGetObject" ( _

   BYVAL pszName AS STRING, _  ' Null-terminated unicode string

   BYVAL pBindOptions AS DWORD, _

   BYREF riid AS GUID, _

   BYREF ppv AS DWORD _

) AS LONG
 

 

CoGetObjectContext

 

Gets the context for the current object.
 

 

DECLARE FUNCTION CoGetObjectContext _

   LIB "OLE32.DLL" _

   ALIAS "CoGetObjectContext" ( _

   BYREF riid AS GUID, _

   BYREF ppv AS DWORD _

) AS LONG
 

 

CoGetPSClsid

 

This function returns the CLSID of the DLL that implements the proxy and stub for the specified interface.
 

 

DECLARE FUNCTION CoGetPSClsid _

   LIB "OLE32.DLL" _

   ALIAS "CoGetPSClsid" ( _

   BYREF riid AS GUID, _

   BYREF pclsid AS GUID _

) AS LONG
 

 

CoGetStandardMarshal

 

Creates a default, or standard, marshaling object in either the client process or the server process, depending on the caller, and returns a pointer to that object's IMarshal implementation.

 

 

DECLARE FUNCTION CoGetStandardMarshal _

   LIB "OLE32.DLL" _

   ALIAS "CoGetStandardMarshal" ( _

   BYREF riid AS GUID, _

   BYVAL pUnk AS DWORD, _

   BYVAL dwDestContext AS DWORD, _

   BYVAL pvDestContext AS DWORD, _

   BYVAL mshlflags AS DWORD, _

   BYREF ppMarshal AS DWORD _

) AS LONG
 

 

CoGetStdMarshalEx

 

Creates an aggregated standard marshaler for use with lightweight client-side handlers.

 

 

DECLARE FUNCTION CoGetStdMarshalEx _

   LIB "OLE32.DLL" _

   ALIAS "CoGetStdMarshalEx" ( _

   BYVAL pUnkOuter AS DWORD, _

   BYVAL dwSMExFlags AS DWORD, _

   BYREF ppUnkInner AS DWORD _

) AS LONG
 

 

CoGetTreatAsClass

 

Returns the CLSID of an object that can emulate the specified object.

 

 

DECLARE FUNCTION CoGetTreatAsClass _

   LIB "OLE32.DLL" _

   ALIAS "CoGetTreatAsClass" ( _

   BYREF clsidOld AS GUID, _

   BYREF pclsidNew AS GUID _

) AS LONG
 

 

CoImpersonateClient

 

Allows the server to impersonate the client of the current call for the duration of the call.

 

 

DECLARE FUNCTION CoImpersonateClient _

   LIB "OLE32.DLL" _

   ALIAS "CoImpersonateClient" ( _

) AS LONG
 

 

CoInitialize

 

Initializes the COM library on the current thread and identifies the concurrency model as single-thread apartment (STA). Applications must initialize the COM library before they can call COM library functions other than CoGetMalloc and memory allocation functions.
 

 

DECLARE FUNCTION CoInitialize _

   LIB "OLE32.DLL" _

   ALIAS "CoInitialize" ( _

   BYREF pvReserved AS DWORD _

) AS LONG
 

 

CoInitializeEx

 

Initializes the COM library for use by the calling thread, sets the thread's concurrency model, and creates a new apartment for the thread if one is required.
 

 

DECLARE FUNCTION CoInitializeEx _

   LIB "OLE32.DLL" _

   ALIAS "CoInitializeEx" ( _

   BYREF pvReserved AS DWORD, _

   BYVAL dwCoInit AS DWORD _

) AS LONG
 

 

CoInitializeSecurity

 

Registers security and sets the default security values for the process. This function is called exactly once per process, either explicitly or implicitly. It can be called by the client, server, or both. For legacy applications and other applications that do not explicitly call CoInitializeSecurity, COM calls this function implicitly with values from the registry. If you set processwide security using the registry and then call CoInitializeSecurity, the AppID registry values will be ignored and the CoInitializeSecurity values will be used.
 

 

DECLARE FUNCTION CoInitializeSecurity _

   LIB "OLE32.DLL" _

   ALIAS "CoInitializeSecurity" ( _

   BYVAL pVoid AS DWORD, _

   BYVAL cAuthSvc AS LONG, _

   BYVAL asAuthSvc AS DWORD, _

   BYVAL pReserved1 AS DWORD, _

   BYVAL dwAuthnLevel AS DWORD, _

   BYVAL dwImpLevel AS DWORD, _

   BYVAL pAuthList AS DWORD, _

   BYVAL dwCapabilities AS DWORD, _

   BYVAL pReserved3 AS DWORD _

) AS LONG
 

 

CoInstall

 

Installs the requested COM server application. This function is likely to be deprecated in future releases.
 

 

DECLARE FUNCTION CoInstall _

   LIB "OLE32.DLL" _

   ALIAS "CoInstall" ( _

   BYVAL pbc AS DWORD, _

   BYVAL dwFlags AS DWORD, _

   BYVAL pClassSpec AS DWORD, _

   BYVAL pQuery AS DWORD, _

   BYVAL pszCodeName AS DWORD' Must be mull

) AS LONG
 

 

CoInvalidateRemoteMachineBindings

 

Installs the requested COM server application. This function is likely to be deprecated in future releases.
 

 

DECLARE FUNCTION CoInvalidateRemoteMachineBindings _

   LIB "OLE32.DLL" _

   ALIAS "CoInvalidateRemoteMachineBindings" ( _

   BYVAL pszMachineName AS STRING' Null-terminated unicode string

) AS LONG
 

 

CoIsHandlerConnected

 

Determines whether a remote object is connected to the corresponding in-process object.
 

 

DECLARE FUNCTION CoIsHandlerConnected _

   LIB "OLE32.DLL" _

   ALIAS "CoIsHandlerConnected" ( _

   BYVAL pUnk AS DWORD _

) AS LONG
 

 

CoIsOle1Class

 

Determines if a given CLSID represents an OLE 1 object.
 

 

DECLARE FUNCTION CoIsOle1Class _

   LIB "OLE32.DLL" _

   ALIAS "CoIsOle1Class" ( _

   BYREF riid AS GUID _

) AS LONG
 

 

CoLoadLibrary

 

Loads a specific DLL into the caller's process. CoLoadLibrary is equivalent to LoadLibraryEx. CoLoadLibrary does not do anything about the lifetime of the library.
 

 

DECLARE FUNCTION CoLoadLibrary _

   LIB "OLE32.DLL" _

   ALIAS "CoLoadLibrary" ( _

   BYVAL lpszLibName AS STRING, _  ' Null-terminated unicode string

   BYVAL bAutoFree AS LONG _

) AS LONG
 

 

CoLockObjectExternal

 

Called either to lock an object to ensure that it stays in memory, or to release such a lock. Call CoLockObjectExternal to place a strong lock on an object to ensure that it stays in memory.
 

 

DECLARE FUNCTION CoLockObjectExternal _

   LIB "OLE32.DLL" _

   ALIAS "CoLockObjectExternal" ( _

   BYVAL pUnk AS DWORD, _

   BYVAL fLock AS LONG, _

   BYVAL fLastUnlockReleases AS LONG _

) AS LONG
 

 

CoMarshalHresult

 

Marshals an HRESULT to the specified stream, from which it can be unmarshaled using the CoUnmarshalHresult function.
 

 

DECLARE FUNCTION CoMarshalHresult _

   LIB "OLE32.DLL" _

   ALIAS "CoMarshalHresult" ( _

   BYVAL pStm AS DWORD, _

   BYVAL hresult AS LONG _

) AS LONG
 

 

CoMarshalInterface

 

Writes into a stream the data required to initialize a proxy object in some client process. The COM library in the client process calls the CoUnmarshalInterface function to extract the data and initialize the proxy. Before calling CoUnmarshalInterface, seek back to the original position in the stream. CoMarshalInterface can marshal only interfaces derived from IUnknown.
 

 

DECLARE FUNCTION CoMarshalInterface _

   LIB "OLE32.DLL" _

   ALIAS "CoMarshalInterface" ( _

   BYVAL pStm AS DWORD, _

   BYREF riid AS GUID, _

   BYVAL pUnk AS DWORD, _

   BYVAL dwDestContext AS DWORD, _

   BYVAL pvDestContext AS DWORD, _

   BYVAL mshlflags AS DWORD _

) AS LONG
 

 

CoMarshalInterThreadInterfaceInStream

 

Marshals an interface pointer from one thread to another thread in the same process.
 

 

DECLARE FUNCTION CoMarshalInterThreadInterfaceInStream _

   LIB "OLE32.DLL" _

   ALIAS "CoMarshalInterThreadInterfaceInStream" ( _

   BYREF riid AS GUID, _

   BYVAL pUnk AS DWORD, _

   BYREF ppStm AS DWORD _

) AS LONG
 

 

CoQueryAuthenticationServices

 

Marshals an interface pointer from one thread to another thread in the same process.
 

 

DECLARE FUNCTION CoQueryAuthenticationServices _

   LIB "OLE32.DLL" _

   ALIAS "CoQueryAuthenticationServices" ( _

   BYREF pcAuthSvc AS DWORD, _

   BYREF asAuthSvc AS DWORD _

) AS LONG
 

 

CoQueryClientBlanket

 

Marshals an interface pointer from one thread to another thread in the same process.
 

 

DECLARE FUNCTION CoQueryClientBlanket _

   LIB "OLE32.DLL" _

   ALIAS "CoQueryClientBlanket" ( _

   BYREF pAuthSvc AS DWORD, _

   BYREF pAuthzSvc AS DWORD, _

   BYREF pServerprincName AS DWORD, _

   BYREF pAuthLevel AS DWORD, _

   BYREF pImpLevel AS DWORD, _

   BYREF pPrivs AS DWORD, _

   BYREF pCapabilities AS DWORD _

) AS LONG
 

 

CoQueryProxyBlanket

 

Retrieves the authentication information the client uses to make calls on the specified proxy. This is a helper function for IClientSecurity::QueryBlanket.
 

 

DECLARE FUNCTION CoQueryProxyBlanket _

   LIB "OLE32.DLL" _

   ALIAS "CoQueryProxyBlanket" ( _

   BYVAL pProxy AS DWORD, _

   BYREF pAuthSvc AS DWORD, _

   BYREF pAuthzSvc AS DWORD, _

   BYREF pServerprincName AS DWORD, _

   BYREF pAuthLevel AS DWORD, _

   BYREF pImpLevel AS DWORD, _

   BYREF ppAuthInfo AS DWORD, _

   BYREF pCapabilities AS DWORD _

) AS LONG
 

 

CoRegisterClassObject

 

Registers an EXE class object with OLE so other applications can connect to it. EXE object applications should call CoRegisterClassObject on startup. It can also be used to register internal objects for use by the same EXE or other code (such as DLLs) that the EXE uses.
 

 

DECLARE FUNCTION CoRegisterClassObject _

   LIB "OLE32.DLL" _

   ALIAS "CoRegisterClassObject" ( _

   BYREF rclsid AS GUID, _

   BYVAL pUnk AS DWORD, _

   BYVAL dwClsContext AS DWORD, _

   BYVAL flags AS DWORD, _

   BYREF lpdwRegister AS DWORD _

) AS LONG
 

 

CoRegisterInitializeSpy

 

Registers an implementation of the IInitializeSpy interface. The IInitializeSpy interface is defied to allow developers to perform initialization and cleanup on COM apartments.
 

 

DECLARE FUNCTION CoRegisterInitializeSpy _

   LIB "OLE32.DLL" _

   ALIAS "CoRegisterInitializeSpy" ( _

   BYVAL lpInitializeSpy AS DWORD, _

   BYVAL pUliCookie AS DWORD _

) AS LONG
 

 

CoRegisterMallocSpy

 

Registers an implementation of the IMallocSpy interface in OLE, thereafter requiring OLE to call its wrapper methods around every call to the corresponding IMalloc method. IMallocSpy is defined in OLE to allow developers to debug memory allocations.
 

 

DECLARE FUNCTION CoRegisterMallocSpy _

   LIB "OLE32.DLL" _

   ALIAS "CoRegisterMallocSpy" ( _

   BYVAL pMallocSpy AS DWORD _

) AS LONG
 

 

CoRegisterMessageFilter

 

Registers with OLE the instance of an IMessageFilter interface, which is to be used for handling concurrency issues on the current thread. Only one message filter can be registered for each thread. Threads in multi-threaded apartments cannot have message filters.
 

 

DECLARE FUNCTION CoRegisterMessageFilter _

   LIB "OLE32.DLL" _

   ALIAS "CoRegisterMessageFilter" ( _

   BYVAL lpMessageFilter AS DWORD, _

   BYREF lplpMessageFilter AS DWORD _

) AS LONG
 

 

CoRegisterPSClsid

 

Enables a downloaded DLL to register its custom interfaces within its running process so that the marshaling code will be able to marshal those interfaces.
 

 

DECLARE FUNCTION CoRegisterPSClsid _

   LIB "OLE32.DLL" _

   ALIAS "CoRegisterPSClsid" ( _

   BYREF riid AS GUID, _

   BYREF rclsid AS GUID _

) AS LONG
 

 

CoRegisterSurrogate

 

Registers the surrogate process through its ISurrogate interface pointer.
 

 

DECLARE FUNCTION CoRegisterSurrogate _

   LIB "OLE32.DLL" _

   ALIAS "CoRegisterSurrogate" ( _

   BYVAL pSurrogate AS DWORD _

) AS LONG
 

 

CoRegisterSurrogateEx

 

Registers the specified surrogate process as a COM+ application. All components configured in the COM+ application are then serviced in the surrogate process.
 

 

DECLARE FUNCTION CoRegisterSurrogateEx _

   LIB "OLE32.DLL" _

   ALIAS "CoRegisterSurrogateEx" ( _

   BYREF rguidProcessID AS GUID, _

   BYVAL reserved AS DWORD _

) AS LONG
 

 

CoReleaseMarshalData

 

Registers the specified surrogate process as a COM+ application. All components configured in the COM+ application are then serviced in the surrogate process.
 

 

DECLARE FUNCTION CoReleaseMarshalData _

   LIB "OLE32.DLL" _

   ALIAS "CoReleaseMarshalData" ( _

   BYVAL pStm AS DWORD _

) AS LONG
 

 

CoReleaseServerProcess

 

Decrements the global per-process reference count.
 

 

DECLARE FUNCTION CoReleaseServerProcess _

   LIB "OLE32.DLL" _

   ALIAS "CoReleaseServerProcess" ( _

) AS DWORD
 

 

CoResumeClassObjects

 

Called by a server that can register multiple class objects to inform the OLE SCM about all registered classes, and permits activation requests for those class objects.
 

 

DECLARE FUNCTION CoResumeClassObjects _

   LIB "OLE32.DLL" _

   ALIAS "CoResumeClassObjects" ( _

) AS LONG
 

 

CoRevertToSelf

 

Restores the authentication information on a thread of execution.
 

 

DECLARE FUNCTION CoRevertToSelf _

   LIB "OLE32.DLL" _

   ALIAS "CoRevertToSelf" ( _

) AS LONG
 

 

CoRevokeClassObject

 

Informs OLE that a class object, previously registered with the CoRegisterClassObject function, is no longer available for use.
 

 

DECLARE FUNCTION CoRevokeClassObject _

   LIB "OLE32.DLL" _

   ALIAS "CoRevokeClassObject" ( _

   BYVAL dwRegister AS DWORD _

) AS LONG
 

 

CoRevokeInitializeSpy

 

Revokes a registered implementation of the IInitializeSpy interface.
 

 

DECLARE FUNCTION CoRevokeInitializeSpy _

   LIB "OLE32.DLL" _

   ALIAS "CoRevokeInitializeSpy" ( _

   BYVAL pUliCookie AS DWORD _

) AS LONG
 

 

CoRevokeMallocSpy

 

Revokes a registered IMallocSpy object.
 

 

DECLARE FUNCTION CoRevokeMallocSpy _

   LIB "OLE32.DLL" _

   ALIAS "CoRevokeMallocSpy" ( _

) AS LONG
 

 

CoSetCancelObject

 

Sets (registers) or resets (unregisters) a cancel object for use during subsequent cancel operations on the current thread.
 

 

DECLARE FUNCTION CoSetCancelObject _

   LIB "OLE32.DLL" _

   ALIAS "CoSetCancelObject" ( _

   BYVAL pUnk AS DWORD _

) AS LONG
 

 

CoSetProxyBlanket

 

Sets the authentication information that will be used to make calls on the specified proxy. This is a helper function for IClientSecurity::SetBlanket.
 

 

DECLARE FUNCTION CoSetProxyBlanket _

   LIB "OLE32.DLL" _

   ALIAS "CoSetProxyBlanket" ( _

   BYVAL pProxy AS DWORD, _

   BYVAL dwAuthnSvc AS DWORD, _

   BYVAL dwAuthzSvc AS DWORD, _

   BYVAL pServerPrincName AS DWORD, _

   BYVAL dwAuthnLevel AS DWORD, _

   BYVAL dwImpLevel AS DWORD, _

   BYVAL pAuthInfo AS DWORD, _

   BYVAL dwCapabilities AS DWORD _

) AS LONG
 

 

CoSuspendClassObjects

 

Prevents any new activation requests from the SCM on all class objects registered within the process.
 

 

DECLARE FUNCTION CoSuspendClassObjects _

   LIB "OLE32.DLL" _

   ALIAS "CoSuspendClassObjects" ( _

) AS LONG
 

 

CoSwitchCallContext

 

Switches the call context object used by CoGetCallContext.

 

 

DECLARE FUNCTION CoSwitchCallContext _

   LIB "OLE32.DLL" _

   ALIAS "CoSwitchCallContext" ( _

   BYVAL pNewObject AS DWORD, _

   BYREF ppOldObject AS DWORD _

) AS LONG
 

 

CoTaskMemAlloc

 

Allocates a block of task memory in the same way that IMalloc::Alloc does.
 

 

DECLARE FUNCTION CoTaskMemAlloc _

   LIB "OLE32.DLL" _

   ALIAS "CoTaskMemAlloc" ( _

   BYVAL cbSize AS DWORD _

) AS LONG
 

 

CoTaskMemFree

 

Frees a block of task memory previously allocated through a call to the CoTaskMemAlloc or CoTaskMemRealloc function.
 

 

DECLARE SUB CoTaskMemFree _

   LIB "OLE32.DLL" _

   ALIAS "CoTaskMemFree" ( _

   BYVAL pmem AS DWORD _

)
 

 

CoTaskMemRealloc

 

Allocates a block of task memory in the same way that IMalloc::Alloc does.
 

 

DECLARE FUNCTION CoTaskMemRealloc _

   LIB "OLE32.DLL" _

   ALIAS "CoTaskMemRealloc" ( _

   BYVAL pmem AS DWORD, _

   BYVAL cbSize AS DWORD _

) AS DWORD
 

 

CoTestCancel

 

Determines if the call being executed on the server has been canceled by the client.
 

 

DECLARE FUNCTION CoTestCancel _

   LIB "OLE32.DLL" _

   ALIAS "CoTestCancel" ( _

) AS LONG
 

 

CoTreatAsClass

 

Establishes or removes an emulation, in which objects of one class are treated as objects of a different class.
 

 

DECLARE FUNCTION CoTreatAsClass _

   LIB "OLE32.DLL" _

   ALIAS "CoTreatAsClass" ( _

   BYREF clsidOld AS GUID, _

   BYREF clsidNew AS GUID _

) AS LONG
 

 

CoUninitialize

 

Closes the COM library on the current thread, unloads all DLLs loaded by the thread, frees any other resources that the thread maintains, and forces all RPC connections on the thread to close.
 

 

DECLARE SUB CoUninitialize _

   LIB "OLE32.DLL" _

   ALIAS "CoUninitialize" ( _

)

 

 

CoUnmarshalHresult

 

Retrieves the class object from a DLL object handler or object application. DllGetClassObject is called from within the CoGetClassObject function when the class context is a DLL.

 

Note OLE does not provide this function. DLLs that support the OLE Component Object Model (COM) must implement DllGetClassObject in OLE object handlers or DLL applications.
 

 

DECLARE FUNCTION CoUnmarshalHresult _

   LIB "OLE32.DLL" _

   ALIAS "CoUnmarshalHresult" ( _

   BYVAL pStm AS DWORD, _

   BYREF phresult AS DWORD _

) AS LONG

 

 

CoUnmarshalInterface

 

Initializes a newly created proxy using data written into the stream by a previous call to the CoMarshalInterface function, and returns an interface pointer to that proxy.
 

 

DECLARE FUNCTION CoUnmarshalInterface _

   LIB "OLE32.DLL" _

   ALIAS "CoUnmarshalInterface" ( _

   BYVAL pStm AS DWORD, _

   BYREF riid AS GUID, _

   BYREF ppv AS DWORD _

) AS LONG

 

 

CoWaitForMultipleHandles

 

Waits for specified handles to be signaled or for a specified timeout period to elapse.
 

 

DECLARE FUNCTION CoWaitForMultipleHandles _

   LIB "OLE32.DLL" _

   ALIAS "CoWaitForMultipleHandles" ( _

   BYVAL dwFlags AS DWORD, _

   BYVAL dwTimeout AS DWORD, _

   BYVAL cHandles AS DWORD, _

   BYVAL pHandles AS DWORD, _

   BYREF lpdwindex AS DWORD _

) AS LONG

 

 

CreateAntiMoniker

 

Creates and supplies a new anti-moniker.
 

 

DECLARE FUNCTION CreateAntiMoniker _

   LIB "OLE32.DLL" _

   ALIAS "CreateAntiMoniker" ( _

   BYREF ppmnk AS DWORD _

) AS LONG

 

 

CreateAsyncBindCtx

 

Creates an asynchronous bind context for use with asynchronous monikers.
 

 

DECLARE FUNCTION CreateAsyncBindCtx _

   LIB "OLE32.DLL" _

   ALIAS "CreateAsyncBindCtx" ( _

   BYVAL dwReserved AS DWORD, _

   BYVAL pbsc AS DWORD, _

   BYVAL penumfmtetc AS DWORD, _

   BYREF ppbc AS DWORD _

) AS LONG

 

 

CreateBindCtx

 

Supplies a pointer to an implementation of IBindCtx (a bind context object). This object stores information about a particular moniker-binding operation. The pointer this function supplies is required as a parameter in many methods of the IMoniker interface and in certain functions related to monikers.
 

 

DECLARE FUNCTION CreateBindCtx _

   LIB "OLE32.DLL" _

   ALIAS "CreateBindCtx" ( _

   BYVAL reserved AS DWORD, _

   BYREF ppbc AS DWORD _

) AS LONG

 

 

CreateClassMoniker

 

Creates a class moniker that refers to the given class.
 

 

DECLARE FUNCTION CreateClassMoniker _

   LIB "OLE32.DLL" _

   ALIAS "CreateClassMoniker" ( _

   BYREF rclsid AS GUID, _

   BYREF ppmk AS DWORD _

) AS LONG

 

 

CreateFileMoniker

 

Creates a file moniker based on the specified path.
 

 

DECLARE FUNCTION CreateFileMoniker _

   LIB "OLE32.DLL" _

   ALIAS "CreateFileMoniker" ( _

   BYVAL lpszPathName AS STRING, _  ' Null-terminated unicode string

   BYREF ppmk AS DWORD _

) AS LONG

 

 

CreateGenericComposite

 

Performs a generic composition of two monikers and supplies a pointer to the resulting composite moniker.
 

 

DECLARE FUNCTION CreateGenericComposite _

   LIB "OLE32.DLL" _

   ALIAS "CreateGenericComposite" ( _

   BYVAL pmkFirst AS DWORD, _

   BYVAL pmkRest AS DWORD, _

   BYREF ppmkComposite AS DWORD _

) AS LONG

 

 

CreateItemMoniker

 

Creates an item moniker that identifies an object within a containing object (typically a compound document).
 

 

DECLARE FUNCTION CreateItemMoniker _

   LIB "OLE32.DLL" _

   ALIAS "CreateItemMoniker" ( _

   BYVAL lpszDelim AS DWORD, _

   BYVAL lpszItem AS DWORD, _

   BYREF ppmk AS DWORD _

) AS LONG

 

 

CreateObjRefMoniker

 

Creates an OBJREF moniker based on a pointer to an object.
 

 

DECLARE FUNCTION CreateObjRefMoniker _

   LIB "OLE32.DLL" _

   ALIAS "CreateObjRefMoniker" ( _

   BYVAL pUnk AS DWORD, _

   BYREF ppMk AS DWORD _

) AS LONG

 

 

CreatePointerMoniker

 

Creates a pointer moniker based on a pointer to an object.
 

 

DECLARE FUNCTION CreatePointerMoniker _

   LIB "OLE32.DLL" _

   ALIAS "CreatepointerMoniker" ( _

   BYVAL pUnk AS DWORD, _

   BYREF ppmk AS DWORD _

) AS LONG

 

 

DllCanUnloadNow

 

Determines whether the DLL that implements this function is in use. If not, the caller can unload the DLL from memory.

 

Note OLE does not provide this function. DLLs that support the OLE Component Object Model (COM) should implement and export DllCanUnloadNow.
 

 

DECLARE FUNCTION DllCanUnloadNow _

   ALIAS "DllCanUnloadNow" ( _

) AS LONG

 

 

DllGetClassObject

 

Retrieves the class object from a DLL object handler or object application. DllGetClassObject is called from within the CoGetClassObject function when the class context is a DLL.

 

Note OLE does not provide this function. DLLs that support the OLE Component Object Model (COM) must implement DllGetClassObject in OLE object handlers or DLL applications.
 

 

DECLARE FUNCTION DllGetClassObject _

   ALIAS "DllGetClassObject" ( _

   BYREF rclsid AS GUID, _

   BYREF riid AS GUID, _

   BYREF ppv AS DWORD _

) AS LONG

 

 

DllRegisterServer

 

Instructs an in-process server to create its registry entries for all classes supported in this server module. If this function fails, the state of the registry for all its classes is indeterminate.
 

 

DECLARE FUNCTION DllRegisterServer _

   LIB "OLE32.DLL" _

   ALIAS "DllRegisterServer" ( _

) AS LONG

 

 

DllUnregisterServer

 

Instructs an in-process server to remove only those entries created through DllRegisterServer.
 

 

DECLARE FUNCTION DllUnregisterServer _

   LIB "OLE32.DLL" _

   ALIAS "DllUnregisterServer" ( _

) AS LONG

 

 

FAILED

 

Provides a generic test for failure on any status value. Negative numbers indicate failure.
 

 

FUNCTION FAILED (BYVAL nStatus AS LONG) AS LONG
   FUNCTION = -(nStatus < 0)

END FUNCTION
 

 

GetClassFile

 

Supplies the CLSID associated with the given filename.
 

 

DECLARE FUNCTION GetClassFile _

   LIB "OLE32.DLL" _

   ALIAS "GetClassFile" ( _

   BYVAL szFileName AS STRING, _  ' Null-terminated unicode string

   BYREF pclsid AS GUID _

) AS LONG

 

 

GetRunningObjectTable

 

Supplies a pointer to the IRunningObjectTable interface on the local Running Object Table (ROT).
 

 

DECLARE FUNCTION GetRunningObjectTable _

   LIB "OLE32.DLL" _

   ALIAS "GetRunningObjectTable" ( _

   BYVAL reserved AS DWORD, _

   BYREF pprot AS DWORD _

) AS LONG

 

 

HRESULT_CODE

 

Provides a generic test for failure on any status value. Negative numbers indicate failure.
 

 

FUNCTION HRESULT_CODE (BYVAL hr AS LONG) AS LONG
   FUNCTION = (hr AND &H0000FFFF)

END FUNCTION
 

 

HRESULT_FACILITY

 

Returns the facility code from the HRESULT.
 

 

FUNCTION HRESULT_FACILITY (BYVAL hr AS LONG) AS LONG
   FUNCTION = (HIWRD(hr) AND &H00001FFFF)

END FUNCTION
 

 

HRESULT_FROM_NT

 

Returns the facility code from the HRESULT.
 

 

FUNCTION HRESULT_FROM_NT (BYVAL x AS LONG) AS LONG
   FUNCTION = (x OR %FACILITY_NT_BIT)

END FUNCTION
 

 

HRESULT_FROM_WIN32

 

Maps a WIN32 error value into an HRESULT. Note that this assumes WIN32 errors fall in the range of -32k to 32k.
 

 

FUNCTION HRESULT_FROM_WIN32 (BYVAL x AS LONG) AS LONG
   IF x <= 0 THEN
      FUNCTION = x
   ELSE
      FUNCTION = ((x AND &H0000FFFF) OR (%FACILITY_WIN32 * &H10000) OR &H80000000???)
   END IF

END FUNCTION
 

 

HRESULT_SEVERITY

 

Returns the severity bit from the HRESULT.
 

 

FUNCTION HRESULT_SEVERITY (BYVAL nStatus AS LONG) AS LONG
   FUNCTION = -(nStatus < 0)

END FUNCTION
 

 

IIDFromString

 

Converts a string generated by the StringFromIID function back into the original interface identifier (IID).
 

 

DECLARE FUNCTION IIDFromString _

   LIB "OLE32.DLL" _

   ALIAS "IIDFromtString" ( _

   BYVAL lpsz AS STRING, _  ' Null-terminated unicode string

   BYREF lpiid AS GUID _
) AS LONG
 

 

IsAccelerator

 

Determines whether the keystroke maps to an accelerator in the given accelerator table.
 

 

DECLARE FUNCTION IsAccelerator _

   LIB "OLE32.DLL" _

   ALIAS "IsAccelerator" ( _

   BYVAL hAccel AS DWORD, _

   BYVAL cAccelEntries AS LONG, _

   BYREF lpMsg AS tagMsg, _

   BYREF lpwCmd AS WORD _

) AS LONG
 

 

IS_ERROR

 

Returns the severity bit from the HRESULT.
 

 

FUNCTION IS_ERROR (BYVAL nStatus AS DWORD) AS LONG
   FUNCTION = -(ISTRUE (nStatus AND &H80000000???))

END FUNCTION
 

 

IsEqualGUID

 

Determines whether two GUIDs are equal.
 

 

DECLARE FUNCTION IsEqualGUID _

   LIB "OLE32.DLL" _

   ALIAS "IsEqualGUID" ( _

   BYREF rguid1 AS GUID, _

   BYREF rguid2 AS GUID _
) AS LONG
 

 

IsEqualCLSID

 

Determines whether two CLSIDs are equal.
 

 

DECLARE FUNCTION IsEqualCLSID _

   LIB "OLE32.DLL" _

   ALIAS "IsEqualCLSID" ( _

   BYREF rclsid1 AS GUID, _

   BYREF rclsid2 AS GUID _
) AS LONG
 

 

IsEqualIID

 

Determines whether two interface identifiers are equal.
 

 

DECLARE FUNCTION IsEqualIID _

   LIB "OLE32.DLL" _

   ALIAS "IsEqualIID" ( _

   BYREF riid1 AS GUID, _

   BYREF riid2 AS GUID _
) AS LONG
 

 

MAKE_HRESULT

 

Creates an HRESULT value from its component pieces.
 

 

FUNCTION MAKE_HRESULT (BYVAL sev AS DWORD, BYVAL fac AS DWORD, BYVAL code AS DWORD) AS LONG
   SHIFT LEFT sev, 31
   SHIFT LEFT fac, 16
   FUNCTION = (sev OR fac OR code)

END FUNCTION
 

 

MAKE_SCODE

 

Creates an SCODE value from its component pieces. The created SCODE has a structure based on the SCODEs found on 32-bit platforms.
 

 

FUNCTION MAKE_SCODE (BYVAL sev AS DWORD, BYVAL fac AS DWORD, BYVAL code AS DWORD) AS LONG
   SHIFT LEFT sev, 31
   SHIFT LEFT fac, 16
   FUNCTION = (sev OR fac OR code)

END FUNCTION
 

 

MkParseDisplayName

 

Converts a string into a moniker that identifies the object named by the string. This is the inverse of the IMoniker::GetDisplayName operation, which retrieves the display name associated with a moniker.
 

 

DECLARE FUNCTION MkParseDisplayName _

   LIB "OLE32.DLL" _

   ALIAS "MkParseDisplayName" ( _

   BYVAL pbc AS DWORD, _

   BYVAL szUserName AS STRING, _  ' Null-terminated unicode string

   BYREF pchEaten AS DWORD, _

   BYREF ppmk AS DWORD _

) AS LONG
 

 

MonikerCommonPrefixWith

 

Creates a new moniker based on the common prefix that this moniker (the one comprising the data of this moniker object) shares with another moniker. This function is intended to be called only in implementations of IMoniker::CommonPrefixWith.
 

 

DECLARE FUNCTION MonikerCommonPrefixWith _

   LIB "OLE32.DLL" _

   ALIAS "MonikerCommonPrefixWith" ( _

   BYVAL pmkThis AS DWORD, _

   BYVAL pmkOther AS DWORD, _

   BYREF ppmkCommon AS DWORD _

) AS LONG
 

 

MonikerRelativePathTo

 

Provides a moniker that, when composed onto the end of the first specified moniker (or one with a similar structure), yields the second specified moniker. This function is intended for use only by IMoniker::RelativePathTo implementations.
 

 

DECLARE FUNCTION MonikerRelativePathTo _

   LIB "OLE32.DLL" _

   ALIAS "MonikerRelativePathTo" ( _

   BYVAL pmkSrc AS DWORD, _

   BYVAL pmkDest AS DWORD, _

   BYREF ppmkRelPath AS DWORD, _

   BYVAL dwReserved AS LONG _

) AS LONG
 

 

OleDoAutoConvert

 

Automatically converts an object to a new class if automatic conversion for that object class is set in the registry.
 

 

DECLARE FUNCTION OleDoAutoConvert _

   LIB "OLE32.DLL" _

   ALIAS "OleDoAutoConvert" ( _

   BYVAL pStg AS DWORD, _

   BYREF pClsidNew AS GUID _

) AS LONG
 

 

OleGetAutoConvert

 

Determines whether the registry is set for objects of a specified CLSID to be automatically converted to another CLSID, and if so, retrieves the new CLSID.
 

 

DECLARE FUNCTION OleGetAutoConvert _

   LIB "OLE32.DLL" _

   ALIAS "OleGetAutoConvert" ( _

   BYREF clsidOld AS GUID, _

   BYREF pclsidNew AS GUID _

) AS LONG
 

 

OleGetIconOfClass

 

Returns a handle to a metafile containing an icon and a string label for the specified CLSID.
 

 

DECLARE FUNCTION OleGetIconOfClass _

   LIB "OLE32.DLL" _

   ALIAS "OleGetIconOfClass" ( _

   BYREF rclsid AS GUID, _

   BYVAL lpszLabel AS STRING, _  ' Null-terminated unicode string

   BYVAL fUseTypeAsLabel AS LONG _

) AS LONG
 

 

OleGetIconOfFile

 

Returns a handle to a metafile containing an icon and string label for the specified file name.
 

 

DECLARE FUNCTION OleGetIconOfFile _

   LIB "OLE32.DLL" _

   ALIAS "OleGetIconOfFile" ( _

   BYVAL lpszPath AS STRING, _  ' Null-terminated unicode string

   BYVAL fUseFileAsLabel AS LONG _

) AS LONG
 

 

OleIconToCursor

 

Converts an icon to a cursor. For Win32 applications, this function calls the Win32 function CopyCursor(hIcon).
 

 

DECLARE FUNCTION OleIconToCursor _

   LIB "OLE32.DLL" _

   ALIAS "OleIconToCursor" ( _

   BYVAL hInstExe AS DWORD, _

   BYVAL hIcon AS DWORD _

) AS LONG
 

 

OleRegGetMiscStatus

 

Converts an icon to a cursor. For Win32 applications, this function calls the Win32 function CopyCursor(hIcon).
 

 

DECLARE FUNCTION OleRegGetMiscStatus _

   LIB "OLE32.DLL" _

   ALIAS "OleRegGetMiscStatus" ( _

   BYREF rclsid AS GUID, _

   BYVAL dwStatus AS DWORD, _

   BYREF pdwStatus AS DWORD _

) AS LONG
 

 

OleRegGetUserType

 

Gets the user type of the specified class from the registry. Developers of custom DLL object applications use this function to emulate the behavior of the OLE default handler.
 

 

DECLARE FUNCTION OleRegGetUserType _

   LIB "OLE32.DLL" _

   ALIAS "OleRegGetUserType" ( _

   BYREF rclsid AS GUID, _

   BYVAL dwFormOfType AS DWORD, _

   BYREF pszUserType AS DWORD' Null-terminated unicode string

) AS LONG
 

 

OleSetAutoConvert

 

Specifies a CLSID for automatic conversion to a different class when an object of that class is loaded.
 

 

DECLARE FUNCTION OleSetAutoConvert _

   LIB "OLE32.DLL" _

   ALIAS "OleSetAutoConvert" ( _

   BYREF clsidOld AS GUID, _

   BYREF clsidNew AS GUID _

) AS LONG
 

 

ProgIDFromCLSID

 

Retrieves the ProgID for a given CLSID.
 

 

DECLARE FUNCTION ProgIDFromCLSID _

   LIB "OLE32.DLL" _

   ALIAS "ProgIDFromCLSID" ( _

   BYREF rclsid AS GUID, _

   BYREF lplpszProgID AS DWORD _' Null-terminated unicode string

) AS LONG
 

 

SCODE_CODE

 

Extracts the code part of the SCODE.
 

 

FUNCTION SCODE_CODE (BYVAL sc AS LONG) AS LONG
   FUNCTION = (sc AND &H0000FFFF)

END FUNCTION
 

 

SCODE_FACILITY

 

Extracts the facility from the SCODE.
 

 

FUNCTION SCODE_FACILITY (BYVAL hr AS LONG) AS LONG
   FUNCTION = (HIWRD(hr) AND &H00001FFFF)

END FUNCTION
 

 

SCODE_SEVERITY

 

Extracts the severity field from the SCODE.
 

 

FUNCTION SCODE_SEVERITY (BYVAL nStatus AS LONG) AS LONG
   FUNCTION = -(nStatus < 0)

END FUNCTION
 

 

StringFromCLSID

 

Converts a CLSID into a string of printable characters. Different CLSIDs always convert to different strings.
 

 

DECLARE FUNCTION StringFromCLSID _

   LIB "OLE32.DLL" _

   ALIAS "StringFromCLSID" ( _

   BYREF rclsid AS GUID, _

   BYREF ppsz AS DWORD' Null-terminated unicode string

) AS LONG
 

 

StringFromGUID2

 

Converts a globally unique identifier (GUID) into a string of printable characters.
 

 

DECLARE FUNCTION StringFromGUID2 _

   LIB "OLE32.DLL" _

   ALIAS "StringFromGUID2" ( _

   BYREF rguid AS GUID, _

   BYREF lpsz AS DWORD, _  ' Null-terminated unicode string

   BYVAL cchMax AS DWORD _

) AS LONG
 

 

StringFromIID

 

Converts an interface identifier into a string of printable characters.
 

 

DECLARE FUNCTION StringFromIID _

   LIB "OLE32.DLL" _

   ALIAS "StringFromIID" ( _

   BYREF rclsid AS GUID, _

   BYREF lplpsz AS DWORD' Null-terminated unicode string

) AS LONG
 

 

SUCCEEDED

 

Provides a generic test for success on any status value. Non-negative numbers indicate success.
 

 

FUNCTION SUCCEEDED (BYVAL nStatus AS LONG) AS LONG
   FUNCTION = -(nStatus >= 0)

END FUNCTION
 

 

Page last updated on Tuesday, 29 August 2006 01:40:22 +0200