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 ole32, prefix the name with the module name and a period.
OleCreate (ole32)
.
C# Signature:
[DllImport("oleaut32.dll", PreserveSig = false)]
static extern void OleCreatePropertyFrame(IntPtr hwndOwner, int x, int y,
[MarshalAs(UnmanagedType.LPWStr)] string lpszCaption,
int cObjects, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4, ArraySubType = UnmanagedType.IUnknown)] object[] lplpUnk,
int cPages, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 6)] Guid[] lpPageClsID,
int lcid, int dwReserved, int lpvReserved);
VB Signature:
Declare Function OleCreatePropertyFrame Lib "ole32.dll" (TODO) As TODO
VB.Net Signature:
Declare Function OleCreatePropertyFrame Lib "oleaut32" _
(ByVal hwndOwner As IntPtr, _
ByVal x As Int32, _
ByVal y As Int32, _
<MarshalAs(UnmanagedType.LPWStr)> _
ByVal lpszCaption As String, _
ByVal cObjects As Int32, _
<MarshalAs(UnmanagedType.Interface, ArraySubType:=UnmanagedType.IUnknown)> _
ByRef ppUnk As Object, _
ByVal cPages As Int32, _
ByVal pPageClsID As Int32, _
ByVal lcid As Int32, _
ByVal dwReserved As Int32, _
ByVal pvReserved As IntPtr) As Integer
/// <summary>
/// Property pages for a DirectShow filter (e.g. hardware device). These
/// property pages do not support persisting their settings.
/// </summary>
public class DirectShowPropertyPage : PropertyPage
{
/// <summary> COM ISpecifyPropertyPages interface </summary>
protected ISpecifyPropertyPages specifyPropertyPages;
/// <summary> Constructor </summary>
public DirectShowPropertyPage(string name, ISpecifyPropertyPages specifyPropertyPages)
{
Name = name;
SupportsPersisting = false;
this.specifyPropertyPages = specifyPropertyPages;
}
/// <summary>
/// Show the property page. Some property pages cannot be displayed
/// while previewing and/or capturing.
/// </summary>
public override void Show(Control owner)
{
DsCAUUID cauuid = new DsCAUUID();
try
{
int hr = specifyPropertyPages.GetPages( out cauuid );
if ( hr != 0 ) Marshal.ThrowExceptionForHR( hr );
object[] o = new object[] { specifyPropertyPages };
Guid[] guidarray = cauuid.ToGuidArray();
int nelements = guidarray.Length;
/// <summary> Release unmanaged resources </summary>
public new void Dispose()
{
if ( specifyPropertyPages != null )
Marshal.ReleaseComObject( specifyPropertyPages ); specifyPropertyPages = null;
}
[DllImport("oleaut32.dll", CharSet=CharSet.Unicode, ExactSpelling=true) ]
static extern int OleCreatePropertyFrame(IntPtr hwndOwner,
int x,
int y,
[MarshalAs(UnmanagedType.LPWStr)] string lpszCaption,
int cObjects,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4, ArraySubType = UnmanagedType.IUnknown)] object[] lplpUnk,
int cPages,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 6)] Guid[] lpPageClsID,
int lcid,
int dwReserved,
int lpvReserved);
}
}
Changes:
7/6/2012 Dan Woerner : Changed olepro32.dll to oleaut32.dll because olepro32 doesn't work for x64, also changed the uint/UINT32/(and IntPtr reserved) to int because they are easier to deal with
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).