Creo3.0M_VS2012开发设置与调试(Win64)
平台设定 【项目】|【xx属性】—属性页对话框
右上方选择平台为“活动(x64)”,或点击“配置管理器”新建活动(x64)平台
包含文件和库文件 属性页对话框|【配置属性】|下
【VC++目录】中
【包含目录】:<Creo 3.0>\M030\Common Files\protoolkit\includes
(PTK程序实例中函数<Creo 3.0>\M030\Common Files \protoolkit\protk_appls\includes)
【库目录】:<Creo 3.0>\M030\Common Files\protoolkit\x86e_win64\obj
注意:以上两项务必保持默认的“从父级或项目默认设置继承”
【C/C++】|下
【预处理器】中【预处理器定义】:若使用ProMessageDisplay()加 PRO_USE_VAR_ARGS
(或者也可在主cpp文件中加预定义语句 #define PRO_USE_VAR_ARGS 1)
【链接器】|下
【输入】中【附加依赖项】和【忽略特定默认库】(忽略重定义错)设置:
必须包含“ProToolkit.h”,且必须是首个PTK包含头文件,这对异步模式尤为重要。(The include file pro_wchar_t.h ensures that, if a definition of wchar_t has not already been made in an earlier include file, one is provided that is consistent with the Creo Parametric definition of the type. Because this file is included by ProToolkit.h, you should include ProToolkit.h as the very first include file in each source file.)
常用PTK头文件可加到stdafx.h,在添加新CPP文件时就不需设置头文件。
0、Debugging Pro/TOOLKIT DLLs on Windows
ProE executable contains a default exception handler on Windows. This handler will catch and react to exceptions generated by a PTK DLL by default. To allow debugging on Windows without using ProE exception handler, set environment variable ALLOW_MS_DEBUG to true.
Setting ALLOW_MS_DEBUG to true forces ProE executable not to execute the exception handler and thus process will stop in debugger on any exception. Alternatively, it is possible to set exception handling in the debugger to stop on the first occurrence of exception, even for handled exceptions.
DLL调试方法:用户交互的DLL(不是批处理DLL)
1、设置断点(一般可在回调函数中设)后,重新在Debug配置下编译链接生成DLL;
2、启动Creo3.0M(但不注册运行生成的DLL) ;打开操作系统的任务管理器—进程,选xtop.exe,右键—调试—接受警告,“VS实时调试器”中选“<要调试的程序名> — MS VS: VS2012”。此时VS2012进入调试状态,但由于DLL尚未被Creo3.0M5载入,断点不可用(显示为空心圆加叹号!)
3、Creo3.0M中注册并运行生成的DLL,注意注册文件必须是针对Debug配置下生成的DLL。此时VS2012响应,断点变为可用(恢复显示为实心圆);
4、VS2012中可以再设置、删除断点(可能先要在Creo3.0M中交互操作才能停在原有断点处),可以按F10、F11等步进调试,可以查看变量值,等等;
5、如VS2012中不选“调试”—“继续”(F5),则Creo3.0M一般不可操作;可“调试”—“停止调试”(shift+F5)返回Creo3.0M(并不停止或删除DLL)。
(总结——以便于拷贝)
本文来源:https://www.2haoxitong.net/k/doc/8c54e1a2482fb4daa58d4b8a.html
文档为doc格式