Junfeng Zhang

Random notes
随笔 - 47, 评论 - 299, 引用 - 74

导航

标签

每月存档

最新留言

广告

IIS 7

MVP Robert McLaws 关于Longhorn IIS 7的报道.

http://www.longhornblogs.com/robert/archive/2005/05/25/14114.aspx

 

posted on 2005-05-28 15:33:00 by junfeng  评论(5) 阅读(3725)

How do I mix C# and C++ code in a single assembly?

How do I mix C# and C++ code in a single assembly?

 If your C++ code is not compiled with /clr:safe (i.e. it is compiled with /clr or /clr:pure), do the following:

1) compile your C++ code into .obj files

2) compile your C# code into a .netmodule, using /AddModule to reference the C++ .obj files

3) link the C# netmodule directly with the C++ object files using the C++ linker to create a mixed language assembly 

 If your C++ code is compiled with /clr:safe, build your C++ code as a .netmodule.  You can use it just like you would use a .netmodule from any other language.

This applies to .Net framework beta2+.

posted on 2005-05-25 16:15:00 by junfeng  评论(14) 阅读(8483)

Powered by: Joycode.MVC引擎 0.5.2.0