Where can I find the declaration of mscorlib::_AppDomain, mscorlib::_Type etc

1.2k views Asked by At

I am using this for my base https://code.msdn.microsoft.com/CppHostCLR-e6581ee0/sourcecode?fileId=21953&pathId=1366553273

But in my VS2010 I cant get intellisense or go to declaration. I tried google, but it takes me to the .NET documentation.

For example I cant get arguments for (or find where its declared): spDefaultAppDomain->Load_2(bstrAssemblyName, &spAssembly);

_AppDomainPtr spDefaultAppDomain = NULL; _AppDomainPtr is basicly mscorlib::_AppDomain..

Sorry, since I don't have much experience in this type of coding I don't know how to properly formulate the question.

2

There are 2 answers

0
CS. On

You can use OLEView.exe and scroll down to Type Libraries in the navigation pane, find the proper type library, right click and click View, there are the declarations.

1
James Killian On

I found an answer here.

This is how this example declares it:

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

I have tested this in VS2017, for this compiler be sure to set Conformance mode to No in C/C++/Language setting for it to compile properly.