4

I have activex server exe that was building and registering fine on 32bit OS. I wanted to make 64 bit version of that exe by upgrading project to Visual Studio 2010 and changing platform to X64 which apparently doesn't work.

Application itself works but I don't see it registered after running

That.exe /RegServer

I would appreciate any usable advice on migrating activex from 32 to x64.

Code that is processing /RegServer param is below:

if(lstrcmpi(lpszToken, _T("RegServer")) == 0)
  {
   _Module.UpdateRegistryFromResource(IDR_OUTDISKSARG, TRUE);
   nRet = _Module.RegisterServer(TRUE);
   bRun = false;
   break;
  }

32 bit activex is unuable for me since I have to load it in x64 .NET process.

Velja Radenkovic
  • 716
  • 1
  • 6
  • 27
  • Please be specific about how you determined that it wasn't registered? Did you run Process Monitor / RegMon while running the RegServer command to see what registry entries were touched? – EricLaw Dec 22 '10 at 21:04
  • It doesn't appear in the registry and I used 64 bit version of RegDllView.exe to see what components I have registered on system. I also tried to load it from net assembly via Interop assembly which clearly states that it isn't registered. Tool is available here: http://www.nirsoft.net/utils/registered_dll_view.html Thanks for response. – Velja Radenkovic Dec 22 '10 at 21:23

2 Answers2

3

Assuming that the process has enough rights to write to the registry, you'll have to take care of that by running it from an elevated command prompt, this is likely to only add the COM registry keys to the registry view that 64-bit processes can see.

32-bit COM clients get a different view of the registry, HKLM\Software\Wow6432Node. It is not going to find the registry keys there. Review RegCreateKeyEx() in the SDK docs. Note the link at the bottom and the talk about the KEY_WOW64_32KEY option. The online article is here.

32-bit clients accessing a 64-bit out-of-process COM server is otherwise a pretty well supported scenario, with some caveats. Like building and registering both the 32-bit and 64-bit proxy/stub DLLs.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
0
  1. When you run That.exe /RegServer, did you do that from an Administrator command prompt? If not that's probably why it didn't work.

  2. If you did and it still didn't work, try debugging it to see what it's doing to the registry. e.g. Use Process Monitor, or even the Visual Studio debugger (remembering to ensure the debugger runs your app as admin).

Leo Davidson
  • 6,093
  • 1
  • 27
  • 29
  • Running as Administrator registered component on OS. Thank you guys very much. However, I would like to ask one more question. I have a setup project that is doing this same registration of same activeX. Is this installation program (or any other process that wants to do That.exe /RegServer) going to require running it from Admin account? – Velja Radenkovic Dec 23 '10 at 11:49
  • The installer will require admin, yes. Installers almost always trigger a UAC prompt anyway, though; you usually have to go out of your way to stop it happening. – Leo Davidson Dec 23 '10 at 12:21