Discussion:
OldCreatePropertyFrame failing in Vista64
(too old to reply)
Blakeyrat
2008-12-07 02:25:00 UTC
Permalink
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.
Mario Noack
2008-12-12 13:22:26 UTC
Permalink
You can't use a 32Bit dll in a 64Bit application. You must set compiler
options fix to 32Bit. There is no other known way....

Best regards,
Mario Noack
Post by Blakeyrat
[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
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.
Blakeyrat
2008-12-12 14:17:00 UTC
Permalink
I know that, I said as much in my original question.

My question is, since the method outlined above obviously doesn't work in
64-bit, what IS the correct way of doing it in 64-bit?
Post by Mario Noack
You can't use a 32Bit dll in a 64Bit application. You must set compiler
options fix to 32Bit. There is no other known way....
Best regards,
Mario Noack
Post by Blakeyrat
[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
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.
Mario Noack
2008-12-15 14:21:47 UTC
Permalink
There is no correct way using DirectX in managed 64 Bit. If you will use
64Bit, you should look for XNA. IMO Managed DirectX is obsolete and actuall
managed way is XNA. Sorry, my english is not good and I know, if you known
this fact...

Mario Noack
Post by Blakeyrat
I know that, I said as much in my original question.
My question is, since the method outlined above obviously doesn't work in
64-bit, what IS the correct way of doing it in 64-bit?
Post by Mario Noack
You can't use a 32Bit dll in a 64Bit application. You must set compiler
options fix to 32Bit. There is no other known way....
Best regards,
Mario Noack
Post by Blakeyrat
[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
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.
Loading...