Regsvr32 Hangs

Regsvr32 Hangs

Post by Jonathan W » Mon, 06 Jun 2005 01:03:28


Hi,

I'm taking over a project, which is basically a huge OCX file that will be
housed on an HTML page.

After some tweaking, I'm able to compile the project under Visual Studio
2003. Everything seems to work except when it goes to register the control:
it just hangs.

I removed the registration step from the build and compiled the OCX. Then I
went to a DOS window and entered:

regsvr32 [myfile].ocx

When I do this, the command line comes right back with no error messages.
All appears normal. However, using Process Explorer, I can see that regsvr32
never terminates. The process remains until I manually terminate it.

I then changed the debugging command for the project to be regsvr32.exe with
my OCX as the argument. I set a breakpoint at the start of DllRegisterServer
and ran the project in debug mode. But my breakpoint is never hit. The
program just hangs there until I manually terminate it.

For some reason, Regsvr32 just hangs. I had an old version lying around,
which was getting loaded but I just uninstalled that entire program.

I don't mind researching this myself but I have no idea where else to look.
Any tips or suggestions would be greatly appreciated.

--
Jonathan Wood
SoftCircuits
http://www.yqcomputer.com/
Available for consulting: http://www.yqcomputer.com/
 
 
 

Regsvr32 Hangs

Post by Jonathan W » Mon, 06 Jun 2005 02:34:35

Severian,


Heh, he's not local so... <g>

You are 100% correct though. I was able to trace it down to a call to
CoCreateInstance that doesn't return. Will do some more research.

Thanks!

--
Jonathan Wood
SoftCircuits
http://www.yqcomputer.com/
Available for consulting: http://www.yqcomputer.com/

 
 
 

Regsvr32 Hangs

Post by Joseph M. » Mon, 06 Jun 2005 12:57:41

Does CoCreateInstance perhaps spawn a thread? If it does, it would be fatal in DllMain. Go
to Debug>Threads and see if a thread is hung on a kernel call. This would suggest it is
blocked on the CRITICAL_SECTION which is protecting DllMain. Look at the number of threads
before the CoCreateInstance call, then after it hangs, break into it and see if the number
of threads has increased.

I have tested out code like this by going into the project and setting the Debug option to
run a specific executable (in my case it was IE, but RegSvr32 would be a candidate also).
Just put the command line in the debug window. I then set a breakpoint in my DllMain, and
was able to single-step to what I'd done wrong.
joe




Joseph M. Newcomer [MVP]
email: XXXX@XXXXX.COM
Web: http://www.yqcomputer.com/
MVP Tips: http://www.yqcomputer.com/
 
 
 

Regsvr32 Hangs

Post by Alexander » Mon, 06 Jun 2005 13:59:26

I think it's generally prohibited to create objects in DllMain.
CoCreateInstance may cause loading another DLL, which is not allowed in
DllMain.

OTOH, if you need to start a thread from DllMain, you need to call
DisableThreadLibraryCalls for your DLL first.
 
 
 

Regsvr32 Hangs

Post by Jonathan W » Tue, 07 Jun 2005 10:50:04

I'm not sure what CoCreateInstance does here and right now the owner of the
project wants to work out this specific problem.

One thing I can tell you is that the program has been working under Visual
Studio 6, and now we are seeing these errors when compiling under Visual
Studio 2003. So the solution is probably a stupid one but, either way, he's
saving paying me to work on new logic and not fix existing code, which is
fine by me.

Thanks.

--
Jonathan Wood
SoftCircuits
http://www.yqcomputer.com/
Available for consulting: http://www.yqcomputer.com/



fatal in DllMain. Go
suggest it is
number of threads
see if the number
Debug option to
candidate also).
my DllMain, and
 
 
 

Regsvr32 Hangs

Post by Rail Jon R » Tue, 28 Jun 2005 09:57:54

Recently I have an issue with my system where I can't install a certain
program (Waves Diamond Bundle).. it'll hang when the DLL's are attempting to
be registered -- I've found that I can't manually register a DLL either..
regsvr32 hangs just as you describe. I'm trying to figure out what's
changed on my system to cause this issue... I was concerned about a
possible virus attack. Have you only seen this since doing any recent XP
updates?

Rail
--
Recording Engineer/Software Developer
Rail Jon Rogut Software
http://www.yqcomputer.com/
mailto: XXXX@XXXXX.COM
 
 
 

Regsvr32 Hangs

Post by Jonathan W » Tue, 28 Jun 2005 13:13:50

was hired as a consulting on this project to write new code and so the
owner decided to try to resolve existing issues with the existing
developers. As near as I can tell, the problem is related to missing or
incorrectly registered components that the project relies on. I believe he
has worked through most of those issue.

I have no indicate that this could be related to any type of virus.

--
Jonathan Wood
SoftCircuits
http://www.softcircuits.com
Available for consulting: http://www.softcircuits.com/jwood/resume.htm

"Rail Jon Rogut" < XXXX@XXXXX.COM > wrote in message
news:maIve.12678$ XXXX@XXXXX.COM ...
to
Visual
is
would
the
and
a
in
its
it