Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than Interfaces, prefix the name with the module name and a period.
//IMPORTANT: The order of the methods is critical here. You
//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. Therefore, if you switched these
//method declarations and tried to call the Exec method on an
//IOleCommandTarget interface from your application, it would
//translate into a call to the QueryStatus method instead.
void QueryStatus(
ref Guid pguidCmdGroup,
UInt32 cCmds,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] OLECMD[] prgCmds,
ref OLECMDTEXT CmdText);
void Exec(
ref Guid pguidCmdGroup,
uint nCmdId,
uint nCmdExecOpt,
ref object pvaIn,
ref object pvaOut);
}
VB Definition:
<ComImport> _
<Guid("TODO")> _
'TODO: Insert <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _ if this doesn't derive from IDispatch
Interface IOleCommandTarget
TODO
End Interface
User-Defined Types:
None.
Notes:
None.
The above didn't work as is in C#. I looked on other sites and found this declaration which works for me (at least with Exec function) :
C# Definition:
[StructLayout(LayoutKind.Sequential)]
public struct OLECMD
{
public UInt32 cmdID;
public UInt64 cmdf;
}
[StructLayout(LayoutKind.Sequential)]
public struct OLECMDTEXT
{
public UInt32 cmdtextf;
public UInt32 cwActual;
public UInt32 cwBuf;
public char rgwz;
}
[ComImport, Guid("b722bccb-4e68-101b-a2bc-00aa00404770"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IOleCommandTarget
{
//IMPORTANT: The order of the methods is critical here. You
//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. Therefore, if you switched these
//method declarations and tried to call the Exec method on an
//IOleCommandTarget interface from your application, it would
//translate into a call to the QueryStatus method instead.
[PreserveSig()]
int QueryStatus([In, MarshalAs(UnmanagedType.Struct)] ref Guid pguidCmdGroup, [MarshalAs(UnmanagedType.U4)] int cCmds, [In, Out]IntPtr prgCmds, [In, Out] IntPtr pCmdText);