原创 - Creo3.0M - VS2012二次开发设置、调试

发布时间:2015-05-13 21:33:53   来源:文档文库   
字号:

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文件时就不需设置头文件

0Debugging 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载入,断点可用(显示为空心圆加叹号!)

3Creo3.0M注册并运行生成的DLL,注意注册文件必须是针对Debug配置下生成的DLL。此时VS2012响应,断点变为可用(恢复显示为实心圆)

4VS2012可以置、删除断点(可能先要Creo3.0M中交互操作才能停在原有断点处可以F10F11步进调试可以查看变量值,等等;

5VS2012中不选“调试”—“继续”(F5),则Creo3.0M一般不可操作;可“调试”—“停止调试shift+F5)返回Creo3.0M(并不停止或删除DLL

(总结——以便于拷贝)

本文来源:https://www.2haoxitong.net/k/doc/8c54e1a2482fb4daa58d4b8a.html

《原创 - Creo3.0M - VS2012二次开发设置、调试.doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式