致开

Add C++/CLI support in your legacy code

Just now I'm maintaining an old piece of code, written in C++. And now i  just want to search out some special strings following special pattern, and it seems that there is no good way that the tradition c++ way. So since now the .net is growing almost 7 years old and the c++/cli is coming mature, i decide to take advantage of the .net powerful functionality.

Steps are simple, not very complicated.
Here is the steps.
1. Add the header file (.h).
2. Add the body file (.cpp). Include the header file in the body file.
3. Pop-up the Property page for the body file. Property->C/C++->General->Compile with common language support : common language runtime support
4. If your project is vc++ and uses the precompiled header, go to Property->C/C++->Precompiled Headers->Create/Use Precompiled Header : Not using precompiled header.
5. You also needs to set Property->C/C++->Enable C++ Exception : Yes with SEH Exceptions(/EHa)

ok, now go to rebuild your project and it will works!

Enjoy the power of the .NET!

posted on 2008-12-15 11:50 Xiaxi 阅读(316) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理


<2024年4月>
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

导航

统计

常用链接

留言簿(1)

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜