Register assembly in C++

Aug 1, 2023 at 7:32pm
We hired someone to build a wrapper dll so that our application could use functions in a managed .Net dll. This was done, and the dll works as it's supposed to, but one of the things we must do in order to use it is to run regasm from an elevated command prompt.

The wrapper dll is written in C++. Can what regasm is doing be incorporated into the dll?

C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe "C:\Program Files\NinjaTrader 8\bin\NinjaTrader.Client.dll" /codebase



Last edited on Aug 1, 2023 at 7:33pm
Aug 1, 2023 at 7:49pm
Aug 1, 2023 at 10:23pm
You could call ShellExecuteW() with lpOperation set to "runas" and invoke the regasm.exe program as needed:

https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutew#runas
Last edited on Aug 2, 2023 at 9:41am
Topic archived. No new replies allowed.