Re: regsvr32 error code 0x80004002
- From: "David Ching" <dc@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 10 Dec 2007 05:35:51 GMT
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
.
- Follow-Ups:
- Re: regsvr32 error code 0x80004002
- From: Norman Diamond
- Re: regsvr32 error code 0x80004002
- References:
- regsvr32 error code 0x80004002
- From: Norman Diamond
- Re: regsvr32 error code 0x80004002
- From: SvenC
- Re: regsvr32 error code 0x80004002
- From: Norman Diamond
- Re: regsvr32 error code 0x80004002
- From: Norman Diamond
- regsvr32 error code 0x80004002
- Prev by Date: Re: regsvr32 error code 0x80004002
- Next by Date: Re: regsvr32 error code 0x80004002
- Previous by thread: Re: regsvr32 error code 0x80004002
- Next by thread: Re: regsvr32 error code 0x80004002
- Index(es):
Relevant Pages
|