Kendel Boul

I've built a filter off the ezrgb24 filter using VS2005 C++ and it works perfectly.

I can use it successfully from:

  1. GraphEdit,
  2. from VC++ using CoCreateInstance on Vista and XP
  3. C# using Activator.CreateInstance on Windows XP 32bit

Sadly when I try to use it from C# on Vista 64bit I get the "class not registered" error no matter how I try and load it. I've tried the folowing from within C#:

  1. Activator.CreateInstance
  2. CoCreateInstance directly
  3. Loading a working GRF file into a GraphBuilder object via its IPersistStream interface

All fail with the same error.

Interestingly, running a Registry monitor while using CoCreateInstance from C++ & C# shows that the Registry keys that are read from C# are completely different from those read from C++ making me think that, although I'm pointing at the same DLL, .Net is intercepting the call and doing its own thing.

Has anyone else seen anything like this or have suggestions on what else I can try



Re: DirectShow Development DirectShow filter code sample fails with CLASS_NOT_REGISTERED from .Net on Vista x64 (but not XP 32bit)

Chris P.

64-bit filters are registered seperately from 32-bit filters because they are incompatible with each other. If you are using a 64-bit application environment then you can only load 64-bit filters.

Build a 64-bit version of your filter by creating a new solution platform with the "Configuration Manager" in Visual Studio and selecting "x64" as the target platform.

Additionally in the linker settings set "Target Machine as MachineX64" (/MACHINE:X64).






Re: DirectShow Development DirectShow filter code sample fails with CLASS_NOT_REGISTERED from .Net on Vista x64 (but not XP 32bit)

Kendel Boul

Chris,

I'm building a 32 bit filter on purpose so that I can use it from 32 bit applications. My dev box just happens to be Vista 64 bit machine (which I admit may be asking for trouble ).

It seems to me that if I take an arbitrary 32 bit application, say GraphEdit and any 32 bit filter and they work on both 32 bit and 64 bit platforms (which they do), then I should be able to any other arbitrary 32 bit application, say a .Net 2.0 app and the same 32 bit filter and it should work on both as well.

The reality it is that the .Net 2.0 application works on the 32 bit platform and fails to find the class factory on the 64 bit one which I take to mean that either .Net 2.0 has an issue or the DirectShow Base Classes shipped with the platform SDK do (because they implement the class factory).

That said, you may be on to something and rogue 64bit code may well be the culprit. I will take a closer look at the .Net application and make sure that it is not loading 64bit DLLs anywhere under the covers.

Thanks for your insight.




Re: DirectShow Development DirectShow filter code sample fails with CLASS_NOT_REGISTERED from .Net on Vista x64 (but not XP 32bit)

Chris P.

I have the feeling that the .NET application may decide to run with a native 64-bit environment unless there is a manifest or something else to tell it otherwise. Because it's not native code (like GraphEdit) the environment is that of the op-code interpreter. But I'm not .NET expert so I'm just guessing Smile