-2

我将其用于我的基础https://code.msdn.microsoft.com/CppHostCLR-e6581ee0/sourcecode?fileId=21953&pathId=1366553273

但在我的 VS2010 中,我无法获得智能感知或去声明。我试过谷歌,但它把我带到了 .NET 文档。

例如,我无法获取参数(或找到其声明的位置): spDefaultAppDomain-> Load_2 (bstrAssemblyName, &spAssembly);

_AppDomainPtr spDefaultAppDomain = NULL;_AppDomainPtr 基本上是 mscorlib::_AppDomain..

抱歉,由于我在这种类型的编码方面没有太多经验,所以我不知道如何正确地提出问题。

4

2 回答 2

1

我在这里找到了答案。

这是这个例子声明它的方式:

#pragma comment(lib, "mscoree.lib")
#import "mscorlib.tlb" raw_interfaces_only\
            high_property_prefixes("_get","_put","_putref")\
            rename("ReportEvent", "InteropServices_ReportEvent")
using namespace mscorlib;

我已经在 VS2017 中对此进行了测试,对于此编译器,请务必在 C/C++/Language 设置中将 Conformance 模式设置为 No 以使其正确编译。

于 2020-06-03T12:25:41.120 回答
0

您可以使用 OLEView.exe 并在导航窗格中向下滚动到类型库,找到正确的类型库,右键单击并单击查看,有声明。

于 2015-09-08T11:50:51.287 回答