7

I have an directShow filter: MyFilter.ax

When I try to register MyFilter.ax with Regsvr32 utility it gives NO error or any message(success or failure). But the filter is not registered.

Regsvr32 utility works fine for my other filters.

Why Regsvr32 deoes not give any sucess or failure message? How can I debug my Regsvr32 failure-sucess? Any alternative utility for registering directshow filter which may give meaningfull message?

Best Wishes

Update:

I install clean win7 OS on a virtual machine. Then try to register.Fail again without no message-response from regsvr32.

But then install again a clean win7 OS on virtual machine. Then make all updates. And after i make updates regsvr32 worked and install my filter....I do not know what cause regsvr32 fail and what kind of update fix it. Or is it really an update issue...

Roman R.
  • 68,205
  • 6
  • 94
  • 158
Novalis
  • 2,265
  • 6
  • 39
  • 63

4 Answers4

3

What can take place and exhibit the mentioned behavior is that somewhere in your filter you are in a dead loop, or infinite wait, so DLL's DllRegisterServer never returns. In this case, you will be able to see that each time you try regsvr32 Task Manager shows you one more regsvr32.exe running process, with or without CPU consumption.

If this is what you are having, you will want to attach with debugger and see where exactly you have dead loop there...

Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • 1
    I solve it. It seems that activex can not able to find a 3rd dll...But instead of saying gracefully, regsvr32 enter invalid state.. Debug does not give a valuable info – Novalis Sep 08 '11 at 15:32
2

Check that you don't invoke regsvr32 with /s option

s.ermakovich
  • 2,641
  • 2
  • 26
  • 24
1

I had this problem too and here is what I did to figure out what was wrong :

Set you dll as the startup project.
Go to configuration properties -> Debugging : Set Command to c:\windows\syswow64\regsvr32.exe(or the 32 bit version if you're on a 32 bits system in c:\windows\system32\regsvr32.exe)
Set the Command Arguments to the full path of your dll
Run in debug mode, you should see the popup that your dll is correctly registered, then the execution will hang.
Click to pause execution
Check in the Threads debug window and check what threads are currently active. Check their call stacks since most of the threads (in my case) are hung in ntdll.dll

Eric
  • 19,525
  • 19
  • 84
  • 147
1

You can implement an application like regsvr32 yourself, you just need to load your target dll and call the function DllRegisterServer. You could implement it in C# for example using the following p/invoke declaration:

[DllImport("yourdll.ax")]
private static extern int DllRegisterServer();

You might be able to narrow down the issue this way.

Update:

I would try installing Windows 7 Platform SDK and compiling your DirectShow filter against that. I have seen compatibility issues before with older versions of DirectX in Windows 7 (even missing dlls), although I did not keep the reference (if someone reading this has a reference please post it).

yms
  • 10,361
  • 3
  • 38
  • 68
  • Well, i narrow down the issue. Debug regsvr32 with Dependency Walker. But gives no meaninfull log...It just get generic Acess Violation Error... My active x dll somehow does enter invalid state on some machines. But not all machines . I test it on Windows 7. – Novalis Aug 12 '11 at 06:56
  • 1
    Maybe you are trying to register a 32 bit dll in a 64 bit OS? If that is the case then you need to use c:\windows\syswow64\regsvr32.exe instead of c:\windows\system32\regsvr32.exe – yms Aug 12 '11 at 11:19
  • Or you could be missing a dependency library, like vc-redist. Did you create this .ax file? – yms Aug 12 '11 at 11:21
  • I create this filter file. There seems to be no missing library.If so regsvr32 will tell it.And No i use it on 32 bit OS. But i found other strange thing. I set up a clean win7 OS on virtual machine. Then try to register. It failes also without any mesage from regsvr32. But when i re-install OS again then make all updates then it worked...What kind of mising updates(if so) causes regsvr32 and my filter fail? – Novalis Aug 12 '11 at 12:19