5

I have a problem trying to register DLL. My OS is Windows 7 (x64).

I do it in two different ways:

1) Using regsvr32. I get message "DllRegisterServer ... succeedeed", nevertheless I can't find my CLSID in registry. (And I get "Class not registered" error trying to create an instace of component with this CLSID).In this case, I know that DllRegisterServer is never called (because I create a text file in the beginning of this function and it is not created).

2) Explicitly load my DLL and call DllRegisterServer. In this case, DllRegisterServer returns S_OK, but still I can't find my CLSID in registry and get "Class not registered" error.

I'm sure the code is correct (for it doesn't work only on my OS), so it seems that the problem is in OS. Did anyone face such a problem?

skvadrik
  • 586
  • 1
  • 3
  • 11

3 Answers3

1

http://msdn.microsoft.com/en-us/library/aa384232(v=vs.85).aspx should explain it

Depending on whether your dll is 32bit or 64bit the registry keys are created at separate locations

parapura rajkumar
  • 24,045
  • 1
  • 55
  • 85
  • My DLL is 32bit and I expect registry key to be created in HKEY_CLASSES_ROOT\CLSID. However, I searched the whole registry for it and it isn't there. – skvadrik Jun 25 '11 at 17:40
  • 2
    Did you read the link that i posted ? Try the HKEY_CLASSES_ROOT\Wow6432Node\CLSID key – parapura rajkumar Jun 25 '11 at 17:42
  • Also is your calling app also 32bit. A 32bit native application can only load 32bit dlls and same with 64bit – parapura rajkumar Jun 25 '11 at 17:43
  • 1
    I've registered it manually, now that's ok. Still I see no reason why regsvr32 couldn't do it. Thank you! I've read the link, but I've already searched in HKEY_CLASSES_ROOT\Wow6432Node\CLSID and other directories ---- and my CLSID wasn't there. – skvadrik Jun 25 '11 at 18:06
0

Run command line tool as administrator and then run the register command regsvr32

Mandar
  • 11
  • 2
0

Just solved an identical problem. I've manually added to the existing 32-bit COM new interface, implementation (MyNewClass) and rgs file. But when I've successfully registered my COM using SysWow64\regsvr32.exe I've noticed that my ProgId/CLSID didn't appear under HKCR\CLSID or HKCR\Wow6432Node\CLSID

So, actually I missed few thing:

  1. I had to add OBJECT_ENTRY under BEGIN_OBJECT_MAP in MyApp.cpp file
  2. and add DECLARE_REGISTRY_RESOURCEID(IDR_xxx) to MyNewClass.h file

resource.h

define IDR_xxx 105

ExistingCom.rc

IDR_xxx REGISTRY DISCARDABLE "MyNewClass.rgs"

adspx5
  • 731
  • 7
  • 16