COM Interop无需重新充气 [英] COM Interop without regasm

查看:92
本文介绍了COM Interop无需重新充气的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是受限用户,我需要编写一个Outlook宏,以在Outlook 2003和2007中公开C#库.

I'm a limited user, and I need to write an Outlook macro that exposes a C# library in Outlook 2003 and 2007.

我根本没有任何管理员特权,甚至在安装时也没有任何特权,因此我无法运行RegAsm,也不能(我假设)编写托管加载项.

I do not have any admin privilges at all, not even at install time, so I can't run RegAsm and I can't (I assume) write a managed add-in.

在这种情况下,是否可以通过VBA调用.Net代码?或者有其他解决方案吗?

Is there any way to call .Net code from VBA in this scenario, or are there any other solutions?

这仅用于个人用途,因此丑陋的骇客是完全可以接受的(只要它可行)

This is for personal use only, so an ugly hack is perfectly acceptable (so long as it works)

推荐答案

我通过使用/regfile选项运行regasm,然后在生成的.reg文件中将HKLM替换为HKCU来解决了这个问题.

I solved this by running regasm with the /regfile option, and replacing HKLM with HKCU in the resulting .reg file.

这篇关于COM Interop无需重新充气的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆