Blakeyrat
2008-12-07 02:25:00 UTC
Hello,
I'm trying to write a video-processing app to go along with a robotics
project I'm working on. I've used the DirectShow.Net library
(http://directshownet.sourceforge.net/) to get a basic application running
using their DxTuner-2005 example application.
Everything is working, except the display of the property pages for the
video source. This is done with the following bit of code:
//Get the name of the filter from the FilterInfo struct
FilterInfo filterInfo;
hr = dev.QueryFilterInfo(out filterInfo);
DsError.ThrowExceptionForHR(hr);
// Get the propertypages from the property bag
DsCAUUID caGUID;
hr = pProp.GetPages(out caGUID);
DsError.ThrowExceptionForHR(hr);
//Create and display the OlePropertyFrame
object oDevice = (object)dev;
hr = OleCreatePropertyFrame(this.Handle, 0, 0,
filterInfo.achName, 1, ref oDevice, caGUID.cElems, caGUID.pElems, 0, 0,
IntPtr.Zero);
The definition of OldCreatePropertyFrame is as follows:
//A (modified) definition of OleCreatePropertyFrame found here:
http://groups.google.no/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/db794e9779144a46/55dbed2bab4cd772?lnk=st&q=[DllImport(%22olepro32.dll%22)]&rnum=1&hl=no#55dbed2bab4cd772
[DllImport("olepro32.dll")]
public static extern int OleCreatePropertyFrame(
IntPtr hwndOwner,
int x,
int y,
[MarshalAs(UnmanagedType.LPWStr)] string lpszCaption,
int cObjects,
[MarshalAs(UnmanagedType.Interface, ArraySubType =
UnmanagedType.IUnknown)]
ref object ppUnk,
int cPages,
IntPtr lpPageClsID,
int lcid,
int dwReserved,
IntPtr lpvReserved);
It all looks good. When run, however, I get an exception saying that the
"olepro32.dll" file couldn't be loaded. I've done a bunch of investigation,
and I can't find a ton of information about this problem. This support page
for Visual Basic suggests that the file is available only for applications
running in 32-bit compatibility mode:
http://msdn.microsoft.com/en-us/vbrun/ms788708.aspx
Instead of screwing around with a perfectly good 64-bit application to make
it 32-bit, what is the prescribed/correct way of using a video device's
properties page in 64-bit managed applications?
Thanks in advance for your help.
I'm trying to write a video-processing app to go along with a robotics
project I'm working on. I've used the DirectShow.Net library
(http://directshownet.sourceforge.net/) to get a basic application running
using their DxTuner-2005 example application.
Everything is working, except the display of the property pages for the
video source. This is done with the following bit of code:
//Get the name of the filter from the FilterInfo struct
FilterInfo filterInfo;
hr = dev.QueryFilterInfo(out filterInfo);
DsError.ThrowExceptionForHR(hr);
// Get the propertypages from the property bag
DsCAUUID caGUID;
hr = pProp.GetPages(out caGUID);
DsError.ThrowExceptionForHR(hr);
//Create and display the OlePropertyFrame
object oDevice = (object)dev;
hr = OleCreatePropertyFrame(this.Handle, 0, 0,
filterInfo.achName, 1, ref oDevice, caGUID.cElems, caGUID.pElems, 0, 0,
IntPtr.Zero);
The definition of OldCreatePropertyFrame is as follows:
//A (modified) definition of OleCreatePropertyFrame found here:
http://groups.google.no/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/db794e9779144a46/55dbed2bab4cd772?lnk=st&q=[DllImport(%22olepro32.dll%22)]&rnum=1&hl=no#55dbed2bab4cd772
[DllImport("olepro32.dll")]
public static extern int OleCreatePropertyFrame(
IntPtr hwndOwner,
int x,
int y,
[MarshalAs(UnmanagedType.LPWStr)] string lpszCaption,
int cObjects,
[MarshalAs(UnmanagedType.Interface, ArraySubType =
UnmanagedType.IUnknown)]
ref object ppUnk,
int cPages,
IntPtr lpPageClsID,
int lcid,
int dwReserved,
IntPtr lpvReserved);
It all looks good. When run, however, I get an exception saying that the
"olepro32.dll" file couldn't be loaded. I've done a bunch of investigation,
and I can't find a ton of information about this problem. This support page
for Visual Basic suggests that the file is available only for applications
running in 32-bit compatibility mode:
http://msdn.microsoft.com/en-us/vbrun/ms788708.aspx
Instead of screwing around with a perfectly good 64-bit application to make
it 32-bit, what is the prescribed/correct way of using a video device's
properties page in 64-bit managed applications?
Thanks in advance for your help.