64-bit COM server (ActiveX)

I have an activex server exe that builds and registers on a 32 bit OS. I wanted to make a 64-bit version of this exe, upgrading the project to Visual Studio 2010 and changing the platform to X64, which apparently does not work.

The application itself works, but I do not see it registered after launch

That.exe /RegServer 

I would appreciate any helpful advice on porting activex from 32 to x64.

The code that processes the / RegServer switch is below:

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

The 32-bit activex is not available to me, since I have to download it in the x64.NET process.

+4
source share
2 answers
  • When you launched To.exe / RegServer, did you do this from the admin command line? If not, it is probably why this did not work.

  • If you did this and still did not work, try debugging it to see what it does with the registry. for example Use Process Monitor or even the Visual Studio debugger (remember that the debugger launches your application as an administrator).

0
source

Assuming that the process has sufficient permissions to write to the registry, you will have to take care of this by running it from an elevated command prompt, most likely it will only add COM registry keys to the registry view so that 64 can be seen as processes in bits.

32-bit COM clients get a different registry view, HKLM \ Software \ Wow6432Node. It will not find registry keys here. Check out RegCreateKeyEx () in the SDK docs. Pay attention to the link below and tell us about the KEY_WOW64_32KEY option. An article on the Internet is here .

32-bit clients accessing a 64-bit COM server outside the process are otherwise a pretty well-supported scenario with some caveats. Similar to creating and registering both 32-bit and 64-bit proxy / stub DLLs.

+3
source

Source: https://habr.com/ru/post/1333097/


All Articles