> I really think there must be some defect in VC7 here... Can anyone
> help?
Thanks so much for responding. See answers inline...
> What else does depends report?
This is the only error that depends reports.
> Are you linking to the DLL runtime library?
Here is the entire linker command line:
/OUT:"Release/DSSWrap.dll" /INCREMENTAL:NO /NOLOGO /DLL
/IDLOUT:"_DSSWrap.idl" /DEBUG /PDB:"Release/DSSWrap.pdb"
/SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /IMPLIB:"Release/DSSWrap.lib"
/MACHINE:X86 comsvcs.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
> Are you installing it with your application?
I created an installer for may app using visual studio. This dll is a
dependency, so it installs it and tries to register it. I'm able to
reproduce the same problem running regsvr32.exe.
> When regsvr32 fails, exactly what is the error message?
"DllRegisterServer failed. Return was 80070716"
Carl Daniel [VC++ MVP] - 04 Jun 2004 14:26 GMT
>> When regsvr32 fails, exactly what is the error message?
>
> "DllRegisterServer failed. Return was 80070716"
This one is the key. 80070716 = HRESULT_FROM_WIN32(0x716).
0x716 = 1814. Looking in Winerror.h, we find:
//
// MessageId: ERROR_RESOURCE_NAME_NOT_FOUND
//
// MessageText:
//
// The specified resource name cannot be found in the image file.
//
#define ERROR_RESOURCE_NAME_NOT_FOUND 1814L
So the problem has something to do with a resource that's accessed by
DllMain or DllRegisterServer.
Question: What is the OS on the target machine? I'm betting that it's
Win9x, and that you have resource IDs greater than 32767 in your DLL. If
that's the case, the solution is to redo your resource IDs with numbers
below 32767, as higher numbers aren't supported on Win9x.
-cd
George Kustas - 05 Jun 2004 17:28 GMT
> Question: What is the OS on the target machine? I'm betting that it's
> Win9x, and that you have resource IDs greater than 32767 in your DLL. If
> that's the case, the solution is to redo your resource IDs with numbers
> below 32767, as higher numbers aren't supported on Win9x.
The target machine is the same OS as the build machine: Windows XP
Pro, same service levels.
HOWEVER: here is a snip from the resource.h file. Sure enough, there
is a high value generated by Visual Studio:
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 201
#define _APS_NEXT_COMMAND_VALUE 32768
#define _APS_NEXT_CONTROL_VALUE 201
Unfortunately, I change 32768 to 201, rebuilt, and alas, still get the
same error registering it. Any other ideas why I would get a resource
error?
Also worth noting: Whenever I build this DLL on my development
machine, the registration fails the first time after a compilation is
made. I have to do a second build, where no compilation takes place,
and the registration works. Odd, huh?
George Kustas - 05 Jun 2004 19:17 GMT
I finally did something I should have done two days ago (no, not shoot
myself). I completely rebuilt the project from scratch: let the studio
create my COM+ components, and copy/pasted the original COM cpp and h
files into the new project. Everything works okay now. Don't know why,
don't care - who knows what evil lurks in the heart of Visual
Studio...
Sorry to have wasted your time with this one.