You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.4 KiB

Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential)> _
Public Structure OLECMDTEXT
Public cmdtextf As UInt32
Public cwActual As UInt32
Public cwBuf As UInt32
Public rgwz As Char
End Structure
<StructLayout(LayoutKind.Sequential)> _
Public Structure OLECMD
Public cmdID As Long
Public cmdf As UInt64
End Structure
' Interop definition for IOleCommandTarget.
<ComImport(), Guid("b722bccb-4e68-101b-a2bc-00aa00404770"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
Public Interface IOleCommandTarget
' IMPORTANT: The order of the methods is critical here. We're going to
' perform early binding in most cases, so the order of the methods
' here MUST match the order of their vtable layout (which is determined
' by their layout in IDL). The interop calls key off the vtable ordering,
' not the symbolic names, so if you switched these method declarations
' and attempted to call Exec() on an IOleCommandTarget interface from your
' app, it would translate into a call to QueryStatus() instead.
Sub QueryStatus(ByRef pguidCmdGroup As Guid, ByVal cCmds As UInt32, <MarshalAs(UnmanagedType.LPArray, SizeParamIndex:=1)> ByVal prgCmds As OLECMD, ByRef pCmdText As OLECMDTEXT)
Sub Exec(ByRef pguidCmdGroup As Guid, ByVal nCmdId As Long, ByVal nCmdExecOpt As Long, ByRef pvaIn As Object, ByRef pvaOut As Object)
End Interface