Re: regsvr32 error code 0x80004002

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Put a Breakpoint in the DllRegisterServer function of your ATL dll

HRESULT hr = _AtlModule.DllRegisterServer();

Still there.

and press F5.

Done. My breakpoint isn't hit yet, but there's a warning with odd syntax.
Uh, right, why would Windows allow the contents of a message box to be
copied to the clipboard by pressing Ctrl+C, who would ever think of such a
thing. The error message concerns symbols not being available for an
executable file, and the executable file is:
regsvr32.exe'
with one unmatched apostrophe exactly like that. OK, this might explain
why
Visual Studio can't execute regsvr32, but it still doesn't explain why
regsvr32 fails when I type the command in a command prompt.

I'm telling it yes, continue debugging.

Good, it hit my breakpoint.

Stepping through atlbase.h, function DllRegisterServer...
RegisterAppId...
UpdateRegistryAppId calls back into my source file's
DECLARE_REGISTRY_APPID_RESOURCEID macro...
UpdateRegistryFromResourceD...
UpdateRegistryFromResourceDHelper...
AtlCreateRegistrar...
CreateInstance...
_AtlInitialConstruct...
FinalConstruct...
hmm, single stepping seems to have stepped over _AtlFinalConstruct and
InternalFinalConstructRelease...
QueryInterface...
AtlInternalQueryInterface...
InlineIsEqualUnknown... looks like it wasn't unknown...
InlineIsEqualGUID... looks like it was equal...
AddRef...
hey! AtlInternalQueryInterface is about to return E_INVALIDARG! pEntries
is NULL.
hey!! The HRESULT comes out as S_OK!! Do you understand this stuff?
AddReplacement...
_AtlGetThreadACPThunk...
oh neat, I'm not the only one who has trouble with Microsoft's code page
APIs, Microsoft has trouble with them too -- aww, it didn't copy from
_AtlGetThreadACPFake...
oh neat, UpdateRegistryFromResourceDHelper ignores error returns from
AddReplacement, so I'll ignore them too...
AddCommonRGSReplacements...
AtlUpdateRegistryFromResourceD...
AddReplacement...
Add... I don't think I want to trace this... it succeeded...
AddReplacement again... hey did this succeed or did it fail, VS2005 is
playing games...
now I'm back in DllRegisterServer and the call to RegisterAppId
succeeded...
RegisterServer...
RegisterServer...
AtlComModuleRegisterServer or not AtlComModuleRegisterServer, more VS2005
games and this is no longer debuggable.

Starting over...
hitting F10 instead of F11 on _AtlModule.DllRegisterServer...
succeeded...
the call to PrxDllRegisterServer goes to DLLDATA_ROUTINES...
pay dirt, I don't know how to debug DLLDATA_ROUTINES but that one gave an
E_NOINTERFACE.

I don't know what to do about it though.


Sorry to hear that you're in debugging hell with ATL. Don't worry about the
uncooperative thing, I think I got the wrong idea from your tone. Anyway,
look in the resources of your ATL DLL, it contains the registry entries that
get added from DllRegisterServer ( that thing about
UpdateRegistryFromResourceD). See if those registry entries did indeed get
inserted into the registry.

I'm confused... before you were getting an error that regsvr32 couldn't even
do a LoadLibrary() of your DLL, now it seems it is getting loaded and in
fact the exported function DllRegisterServer() is being called. So at least
that is more than what was happening before. But I guess this is for the
debug version?

You can also generate debug info for the Release version and debug that
(almost) as easily... optimizations may make the code not match up exactly
but it will be close enough.

-- David


.



Relevant Pages

  • Re: Heip on debugging
    ... is allowed in this website with the Internet Services Manager. ... After that, start a debug build in VS.NET (or alternately, start Internet ... should be able to hit the breakpoint once the compile is complete. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Heip on debugging
    ... Have checked the .pdb files and they are of same ... (All other projects on the web server debug ok!) ... > should be able to hit the breakpoint once the compile is complete. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Basic Sql Sink Sample
    ... Check to make sure that the EventSinks projects have been compiled in debug ... Crockett ... > Writeand the breakpoint is never hit. ...
    (microsoft.public.vsnet.enterprise.tools)
  • Re: How to debug in function AuthenticateToken()
    ... debug the web service is a little funky. ... allowed to hit the web service it self. ... >> will never hit that breakpoint. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • RE: No hit on breakpoint in webservice
    ... >cannot set breakpoints in the web service visual basic code. ... >hit, execution does not stop). ... >How can I debug the web service visual basic code? ...
    (microsoft.public.dotnet.framework.aspnet.webservices)