admin管理员组

文章数量:1647677

2024年6月5日发(作者:)

Creo3.0M_VS2012开发设置与调试(Win64)

平台设定

【项目】|【xx属性】—属性页对话框

右上方选择平台为“活动(x64)”,或点击“配置管理器”新建活动(x64)平台

包含文件和库文件

属性页对话框|【配置属性】|下

【VC++目录】中

【包含目录】:M030Common Filesprotoolkitincludes

(PTK程序实例中函数M030Common Files protoolkitprotk_applsincludes)

【库目录】:M030Common Filesprotoolkitx86e_win64obj

注意:以上两项务必保持默认的“从父级或项目默认设置继承”

【C/C++】|下

【预处理器】中【预处理器定义】:若使用ProMessageDisplay()加

PRO_USE_VAR_ARGS

(或者也可在主cpp文件中加预定义语句

#define PRO_USE_VAR_ARGS 1

【链接器】|下

【输入】中【附加依赖项】和【忽略特定默认库】(忽略重定义错)设置:

一般必需库

可选库

必须忽略库

可以忽略库

不可忽略库

DLL模式必需

PTK库

多进程模式

必需PTK库

Debug版 Release版

VS系统库 、;

系统进程状态控制库 ;Windows网络应用接口库

, , , , , , ,

, , , , , ws2_

多线程调试库 libcmtd

微软C运行库

msvcrt

(可减少警告)

多线程库 libcmt

微软C运行调试库 msvcrtd

Winows多线程DLL库protk_

Windows多线程DLL库

微软C运行库 msvcrt

微软C运行调试库msvcrtd

多线程调试库libcmtd

多线程库 libcmt

PTK标准库

protk_dll_

PTK标准库

i486_ntobjpro_comm_

环境变量

系统变量

PRO_COMM_MSG_EXE

必需PTK

以上Debug版多进程模式必需库以及: 以上Release版多进程模式必需库及:

Winows多线程DLL库 标准库pt_

必须包含“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 e 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 exceptionhandler on Windows. This handler will catch and react

toexceptions generated by a PTK DLL by allow debugging on Windows without using ProE

exception handler, set environmentvariable ALLOW_MS_DEBUGto

true

.

Setting

ALLOW_MS_DEBUG

to true forces ProEexecutable not to execute the exception handler and thus process

will stop in debugger on any atively, it is possible to set exception handling in thedebugger to stop

on the first occurrence of exception, evenfor handled exceptions.

DLL调试方法:用户交互的DLL(不是批处理DLL)

1、设置断点(一般可在回调函数中设)后,重新在Debug配置下编译链接生成DLL;

2、启动Creo3.0M(但不注册运行生成的DLL);打开操作系统的任务管理器—进程,选,

右键—调试—接受警告,“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)。

(总结——以便于拷贝)

Debug版DLL

Debug版多进程 Release版DLL Release版多进程

protk_

protk_dll_r

libcmtd

msvcrt

libcmt

msvcrt

msvcrtd

libcmtd

本文标签: 调试断点设置文件进程