• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.Windows.App
    • AppQuery
  • Dapplo.Windows.Citrix
    • WinFrame
  • Dapplo.Windows.Citrix.Enums
    • ConnectStates
    • EventMask
    • InfoClasses
  • Dapplo.Windows.Citrix.Structs
    • ClientAddress
    • ClientDisplay
  • Dapplo.Windows.Clipboard
    • ClipboardMonitor
    • ClipboardNative
    • ClipboardUpdateInformation
    • StandardClipboardFormats
  • Dapplo.Windows.Com
    • ComProgIdAttribute
    • ComWrapper
    • DisposableCom
    • IDispatch
    • IDisposableCom<T>
    • IOleCommandTarget
    • IOleWindow
    • IUnknown
  • Dapplo.Windows.Common
    • Win32
    • WindowsVersion
  • Dapplo.Windows.Common.Enums
    • AdjacentTo
    • HResult
    • Win32Error
  • Dapplo.Windows.Common.Extensions
    • HResultExtensions
    • RectExensions
  • Dapplo.Windows.Common.Structs
    • POINT
    • RECT
    • RECTF
    • SIZE
  • Dapplo.Windows.Desktop
    • EnvironmentChangedEventArgs
    • EnvironmentMonitor
    • IInteropWindow
    • InteropWindow
    • InteropWindowExtensions
    • InteropWindowFactory
    • InteropWindowQuery
    • WindowScroller
    • WindowsEnumerator
    • WinEventHook
  • Dapplo.Windows.DesktopWindowsManager
    • Dwm
    • DwmBlurBehind
    • DwmBlurBehindFlags
    • DwmSetIconicLivePreviewFlags
    • DwmThumbnailProperties
    • DwmThumbnailPropertyFlags
    • DwmWindowAttributes
  • Dapplo.Windows.Dpi
    • BitmapScaleHandler
    • BitmapScaleHandler<TKey>
    • DpiAwareness
    • DpiAwarenessContext
    • DpiHandler
    • WinProcListener
  • Dapplo.Windows.Dpi.Enums
    • MonitorDpiType
  • Dapplo.Windows.Dpi.Forms
    • DpiAwareForm
    • FormsExtensions
  • Dapplo.Windows.Dpi.Wpf
    • WindowExtensions
  • Dapplo.Windows.Enums
    • InteropWindowCacheFlags
    • WinEventHookFlags
    • WinEvents
  • Dapplo.Windows.Gdi32
    • Gdi32Api
    • GdiExtensions
    • GdiPlusApi
  • Dapplo.Windows.Gdi32.Enums
    • BitmapCompressionMethods
    • ColorSpaceEnum
    • DeviceCaps
    • GdiPlusStatus
    • GpUnit
    • RasterOperations
  • Dapplo.Windows.Gdi32.SafeHandles
    • SafeCompatibleDcHandle
    • SafeDcHandle
    • SafeDeviceContextHandle
    • SafeDibSectionHandle
    • SafeHBitmapHandle
    • SafeObjectHandle
    • SafeRegionHandle
    • SafeSelectObjectHandle
    • SafeWindowDcHandle
  • Dapplo.Windows.Gdi32.Structs
    • BitfieldColorMask
    • BitmapFileHeader
    • BitmapInfoHeader
    • BlurParams
    • CieXyz
    • CieXyzTripple
  • Dapplo.Windows.Input
    • Hotkey
    • InputGenerator
    • KeyboardHook
    • KeyboardHookEventArgs
    • MouseHook
    • MouseHookEventArgs
  • Dapplo.Windows.Input.Enums
    • ExtendedKeyFlags
    • ExtendedMouseFlags
    • HookTypes
    • InputTypes
    • KeyEventFlags
    • MouseEventFlags
    • ScanCodes
    • VirtualKeyCodes
  • Dapplo.Windows.Input.Structs
    • HardwareInput
    • Input
    • InputUnion
    • KeyboardInput
    • KeyboardLowLevelHookStruct
    • MouseInput
    • MouseLowLevelHookStruct
  • Dapplo.Windows.Interop
    • DisposableCom
    • IDisposableCom<T>
  • Dapplo.Windows.Kernel32
    • Kernel32Api
    • PsApi
  • Dapplo.Windows.Kernel32.Enums
    • GlobalMemorySettings
    • ProcessAccessRights
    • ThreadAccess
    • WindowsProducts
    • WindowsProductTypes
    • WindowsSuites
  • Dapplo.Windows.Kernel32.Structs
    • OsVersionInfoEx
  • Dapplo.Windows.Messages
    • WindowsMessage
    • WindowsMessages
    • WinProcHandler
  • Dapplo.Windows.Multimedia
    • SoundSettings
    • SystemSounds
    • WinMm
  • Dapplo.Windows.Native
    • Shell32
    • Shell32.FolderType
    • Shell32.IconSize
  • Dapplo.Windows.Shell32
    • Shell32Api
  • Dapplo.Windows.Shell32.Enums
    • AppBarEdges
    • AppBarMessages
    • AppBarStates
  • Dapplo.Windows.Shell32.Structs
    • AppBarData
  • Dapplo.Windows.Structs
    • WinEventInfo
  • Dapplo.Windows.User32
    • User32Api
    • User32Api.EnumWindowsProc
  • Dapplo.Windows.User32.Enums
    • ClassLongIndex
    • CursorInfoFlags
    • DesktopAccessRight
    • ExtendedWindowStyleFlags
    • GetWindowCommands
    • MonitorFrom
    • MonitorInfoFlags
    • ObjectIdentifiers
    • ObjectStates
    • PrintWindowFlags
    • RegionResults
    • ScrollBarCommands
    • ScrollBarStateIndexes
    • ScrollBarTypes
    • ScrollInfoMask
    • ScrollModes
    • SendMessageTimeoutFlags
    • ShowWindowCommands
    • SysCommands
    • SystemMetric
    • SystemParametersInfoActions
    • SystemParametersInfoBehaviors
    • TitleBarInfoIndexes
    • WindowLongIndex
    • WindowPlacementFlags
    • WindowPos
    • WindowStyleFlags
  • Dapplo.Windows.User32.SafeHandles
    • SafeCurrentInputDesktopHandle
    • SafeIconHandle
  • Dapplo.Windows.User32.Structs
    • AnimationInfo
    • CursorInfo
    • DisplayInfo
    • IconInfo
    • MonitorInfoEx
    • ScrollBarInfo
    • ScrollInfo
    • TitleBarInfoEx
    • WindowInfo
    • WindowPlacement

Class ComWrapper

Wraps a late-bound COM server.

Inheritance
System.Object
ComWrapper
Namespace: Dapplo.Windows.Com
Assembly: Dapplo.Windows.Com.dll
Syntax
public sealed class ComWrapper : RealProxy, IDisposable, IRemotingTypeInfo

Fields

| Improve this Doc View Source

RPC_E_CALL_REJECTED

Declaration
public const int RPC_E_CALL_REJECTED = null
Field Value
Type Description
System.Int32
| Improve this Doc View Source

RPC_E_FAIL

Declaration
public const int RPC_E_FAIL = null
Field Value
Type Description
System.Int32

Properties

| Improve this Doc View Source

TypeName

Implementation for the interface IRemotingTypeInfo

Declaration
public string TypeName { get; set; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

CanCastTo(Type, Object)

Implementation for the interface IRemotingTypeInfo This makes it possible to cast the COMWrapper

Declaration
public bool CanCastTo(Type toType, object o)
Parameters
Type Name Description
Type toType

Type to cast to

System.Object o

object to cast

Returns
Type Description
System.Boolean
| Improve this Doc View Source

CreateInstance<TCom>()

A simple create instance, doesn't create a wrapper!!

Declaration
public static TCom CreateInstance<TCom>()
Returns
Type Description
TCom

T

Type Parameters
Name Description
TCom

Type of the COM

| Improve this Doc View Source

Dispose()

Cleans up the COM object.

Declaration
public void Dispose()
| Improve this Doc View Source

Equals(Object)

Compares this object to another.

Declaration
public override bool Equals(object value)
Parameters
Type Name Description
System.Object value

The value to compare to.

Returns
Type Description
System.Boolean

true if the objects are equal.

| Improve this Doc View Source

Finalize()

If Dispose() is not called, we need to make sure that the COM object is still cleaned up.

Declaration
protected void Finalize()
| Improve this Doc View Source

GetHashCode()

Returns the hash code of the wrapped object.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

The hash code of the wrapped object.

| Improve this Doc View Source

GetInstance<T>()

Gets a COM object and returns the transparent proxy which intercepts all calls to the object

Declaration
public static T GetInstance<T>()
Returns
Type Description
T

Transparent proxy to the real proxy for the object

Type Parameters
Name Description
T

Interface which defines the method and properties to intercept

Remarks

T must be an interface decorated with the ComProgIdAttributeattribute.

| Improve this Doc View Source

GetOrCreateInstance<T>()

Gets or creates a COM object and returns the transparent proxy which intercepts all calls to the object The ComProgId can be a normal ComProgId or a GUID prefixed with "clsid:"

Declaration
public static T GetOrCreateInstance<T>()
Returns
Type Description
T

Transparent proxy to the real proxy for the object

Type Parameters
Name Description
T

Interface which defines the method and properties to intercept

Remarks

T must be an interface decorated with the ComProgIdAttributeattribute.

| Improve this Doc View Source

Invoke(IMessage)

Intercept method calls

Declaration
public override IMessage Invoke(IMessage myMessage)
Parameters
Type Name Description
IMessage myMessage

Contains information about the method being called

Returns
Type Description
IMessage

A .

| Improve this Doc View Source

ToString()

Returns a string representing the wrapped object.

Declaration
public override string ToString()
Returns
Type Description
System.String

The full name of the intercepted type.

| Improve this Doc View Source

Wrap<T>(Object)

Wrap a com object as COMWrapper

Declaration
public static T Wrap<T>(object comObject)
Parameters
Type Name Description
System.Object comObject

An object to intercept

Returns
Type Description
T

Transparent proxy to the real proxy for the object

Type Parameters
Name Description
T

Interface which defines the method and properties to intercept

  • Improve this Doc
  • View Source
Back to top Copyright © 2017 Dapplo