#include <Windows.h>
#include <MSCorEE.h>
#include <stdio.h>
void main(int argc, WCHAR **argv) {
// Load the CLR
ICLRRuntimeHost *pClrHost;
HRESULT hr = CorBindToRuntimeEx(
NULL, // desired CLR version (NULL=latest)
NULL, // desired GC flavor (NULL=workstation)
0, // desired startup flags
CLSID_CLRRuntimeHost, // CLSID of CLR
IID_ICLRRuntimeHost, // IID of ICLRRuntimeHost
(PVOID*) &pClrHost); // returned COM interface
// (This is where you would set Host managers)
// (This is where you could get CLR managers)
// Initialize and start the CLR
pClrHost->Start();
// Load an assembly and call a static method that
// takes a String and returns an Int32
DWORD retVal;
hr = pClrHost->ExecuteInDefaultAppDomain(
L"..\\..\\..\\D-Host_MgdAssem\\bin\\Debug\\MgdAssem.dll",
L"Wintellect.SomeType", L"SomeMethod", L"Jeff", &retVal);
// Show the result returned from managed code
wprintf(L"Managed code returned %d", retVal);
// Terminate this process (destroying the CLR loaded in it)
}
没有合适的资源?快使用搜索试试~ 我知道了~
框架设计(CLR Via C#) 第二版源代码
共296个文件
cs:167个
csproj:120个
sln:2个
需积分: 17 12 下载量 56 浏览量
2008-12-02
10:58:50
上传
评论
收藏 333KB ZIP 举报
温馨提示
框架设计(CLR Via C#) 第二版源代码
资源详情
资源评论
资源推荐
收起资源包目录
框架设计(CLR Via C#) 第二版源代码 (296个子文件)
build.bat 444B
UnmanagedHost.cpp 1KB
03-ManagedCApp.cpp 458B
SimpleBinder.cs 19KB
Thread.cs 17KB
MailManager.cs 7KB
UnhandledException.cs 6KB
AppDomainMarshalling.cs 6KB
Constraints.cs 6KB
CallbackAPM.cs 5KB
ComparingStringsForSorting.cs 5KB
Invoker.cs 5KB
SimpleBinderTest.cs 5KB
TypeWithLotsOfEvents.cs 5KB
ExceptionTree.cs 5KB
Arrays.cs 4KB
Nullable.cs 4KB
MatchingAttributes.cs 4KB
DelegateReflection.cs 4KB
Monitor.cs 4KB
WeakReferences.cs 4KB
DiskFullException.cs 3KB
VersioningComponentWithVirtualMethods.cs 3KB
Enums.cs 3KB
WaitUntilDoneAPM.cs 3KB
Boxing.cs 3KB
TypesOfTypes.cs 3KB
DelegateOverview.cs 3KB
OutAndRefParameters.cs 3KB
AssemInfo.cs 3KB
GetInvocationList.cs 3KB
ExecutionContext.cs 3KB
BitArray.cs 3KB
CustomAttributeData.cs 3KB
CustomAttributeData.cs 3KB
TypeConstructorPerformance.cs 2KB
BoxingForInterfaceMethod.cs 2KB
MultiDimArrayPerformance.cs 2KB
04-MemoryPressureAndHandleCollector.cs 2KB
EventSet.cs 2KB
Performance.cs 2KB
ThreadPoolAndTLS.cs 2KB
GenericsAndInterfaces.cs 2KB
GCBeep.cs 2KB
DetectingAttributes.cs 2KB
DoubleCheckLocking.cs 2KB
BindingHandles.cs 2KB
ArgumentValidation.cs 2KB
InterfaceDiscover.cs 2KB
PollingAPM.cs 2KB
WaitPulse.cs 2KB
AnonymousMethods.cs 2KB
ComputeAPM.cs 2KB
Casting.cs 2KB
StringInfo.cs 2KB
Volatile.cs 2KB
ConstructorFieldInitialization.cs 2KB
BoxingAndInterfaces.cs 2KB
InterfaceReimplementation.cs 2KB
Inheritance.cs 2KB
GenericMethods.cs 2KB
Mechanics.cs 2KB
EIMINoBaseCall.cs 2KB
ConversionOperators.cs 2KB
AppDomainUnloadTimeout.cs 2KB
SecureString.cs 2KB
MemberDiscover.cs 2KB
WaitHandle.cs 2KB
TypeWithVariousMembers.cs 1KB
Host.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
CodePageConverter.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
GCMethods.cs 1KB
ReferenceVsValue.cs 1KB
EIMITypeSafety.cs 1KB
DisposePattern.cs 1KB
AssemblyInfo.cs 1KB
OpenTypes.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
StackallocAndInlineArrays.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
AssemblyInfo.cs 1KB
共 296 条
- 1
- 2
- 3
chenxiqiudie
- 粉丝: 36
- 资源: 8
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0