Game Development Reference
In-Depth Information
[PreserveSig()]
void GetDataHere(int a, ref StorageMedium b);
[PreserveSig()]
int QueryGetData(int a);
[PreserveSig()]
int GetCanonicalFormatEtc(int a, ref int b);
[PreserveSig()]
int SetData(int a, int b, int c);
[PreserveSig()]
int EnumFormatEtc(uint a, ref Object b);
[PreserveSig()]
int DAdvise(int a, uint b, Object c, ref uint d);
[PreserveSig()]
int DUnadvise(uint a);
[PreserveSig()]
int EnumDAdvise(ref Object a);
}
There are a number of unmanaged Win32 types that must also be defined so that
the unmanaged methods can use them. There are also several unmanaged types
within the structures that will be covered later. It is also important to note the use
of the [StructLayout] attribute. By default, the CLR automatically chooses a layout
for structure members when compiled. This can lead to format problems when
interacting with COM callers. By specifying LayoutKind.Sequential , the structure
layout is defined in the order in which members appear.
The InvokeCommandInfo structure defined below is known as CMINVOKECOMMANDINFO in the
unmanaged world. It contains information needed by IContextMenu.InvokeCommand()
to execute a context menu command.
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct InvokeCommandInfo
{
public uint Size;
public uint Mask;
public uint Window;
Search Nedrilad ::




Custom Search