C++/CLI程序 如何调试

shengzheliu 2010-10-09 12:32:24
我写了一段 C++ 代码 其中加了一点CLI代码 通过 公共语言库设置(/clr) 程序能够编译通过,而且正常运行 ,但是不能在代码中设置断点,(设置了断点,代码会在运行时报错,)哪位高手解决这种问题。谢谢

#include <iostream>

using namespace std;

void main()
{
int i=0;
i++;
i=0;
System::String^ str = "bbs";
}

代码很简单 就是不能下断点 还请高手解决 谢谢
...全文
418 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
shengzheliu 2010-10-10
  • 打赏
  • 举报
回复
配置 调试属性为Mixed 没有用的 运行时还报告错误 “未处理的System.InvalidProgramException类型的异常出现在未知模块中。”“公共语言运行库检测到无效的程序”
Ny-6000 2010-10-09
  • 打赏
  • 举报
回复
帮顶

那就在之前和之后设置断点好了.
Dobzhansky 2010-10-09
  • 打赏
  • 举报
回复
o
在 vs IDE 中右击项目, 属性中的 调试 节中, 有个 Debugger Type 的选项,
这个你要选择 Mixed 就可以同时调试两种(native/managed)代码了
Foundations of C++/CLI: The Visual C++ Language for .NET 3.5 introduces C++/CLI, Microsoft’s extensions to the C++ syntax that allow you to target the common language runtime, the key to the heart of the .NET Framework 3.5. This book gives you a small, fast–paced primer that will kick–start your journey into the world of C++/CLI. In 13 no–fluff chapters, Microsoft insiders take readers into the core of the C++/CLI language and explain both how the language elements work and how Microsoft intends them to be used. This book is a beginner’s guide, but it assumes a familiarity with programming basics. And it concentrates on explaining the aspects of C++/CLI that make it the most powerful and fun language of the .NET Framework. As such, this book is ideal if you’re thinking of migrating to C++/CLI from another language. By the end of this book, you’ll have a thorough grounding in the core language elements together with the confidence to explore further that comes from a solid understanding of a language’s syntax and grammar. What you’ll learn The basics of C++/CLI The object–oriented features of C++/CLI How C++/CLI sits within the .NET Framework 3.5 How to create C++/CLI programs Using STL/CLR Who is this book for Developers wanting to learn C++/CLI About the Author Gordon Hogenson is the manager responsible for the Visual C++ documentation, has worked as a technical writer and testing engineer for Visual C++, C# and other Microsoft products for 9 years. He has avid interests in many diverse fields, including botany and organic gardening, chemistry, physics, metaphysics and philosophy.

7,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 VC.NET
社区管理员
  • VC.NET社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧