Get Started > 安装和测试 Creo TOOLKIT 开发环境 > 测试 Creo Toolkit 安装 > 创建您自己的 Microsoft Visual Studio 项目
创建您自己的 Microsoft Visual Studio 项目
Creo TOOLKIT 加载点包括名为 pt_install_test 的一个简单应用程序的源文件,它专为协助测试安装而设计。构建和运行测试应用程序的步骤如下。
1. 打开 Microsoft Visual Studio。
2. 在空目录中创建一个名为 ProTOOLKITInstall 的项目。将此项目设为 makefile 项目。
3. 设置“调试配置设置”(Debug Configuration Settings),使其运行如下表和下图中所示的 Creo Parametric makefile:
设置
命令行
nmake /f make_install dll
输出
pt_inst_test.dll
清除所有命令
del pt_inst_test.*
重建所有命令
nmake /f make_install dll
包括搜索路径
<creo_loadpoint>\<version>\Common Files\protoolkit\includes
4. “版本配置设置”(Release Configuration Settings) 设为与“调试配置设置”(Debug Configuration Settings) 相同。单击“完成”(Finish)
5. 将文件 make_install<creo_toolkit_loadpoint>/<machine>/obj 复制到项目目录,即也包含 ProTOOLKITInstall.vcproj 的目录 ProTOOLKITInstall。如果您使用的是 64 位 Windows 平台,则从 <creo_toolkit_loadpoint>/x86e_win64/obj 复制该文件。
6. 单击“项目”(Project) > “添加现有项”(Add Existing Item),将 makefile 添加至该项目。在“添加现有项”(Add Existing Item) 窗口中,查看所有文件并选择文件 make_install
7. 编辑 make_installPROTOOL_SRC (EXTERNAL USE - DEFAULT) 的设置,使其指向 Creo TOOLKIT 安装目录,即 <creo_loadpoint>/<version>/Common Files/protoolkit
*如果 Creo Parametric 加载点所在的目录包含空格,请使用 DOS 短名称。
8. 如果使用的是 Windows 64 位平台,执行以下步骤选择平台,否则请转到下一步:
a. 单击“构建”(Build) > “配置管理器”(Configuration Manager)
b. “活动解决方案平台”(Active Solution Platform) 下,选择“新建”(New)“新建解决方案平台”(New Solution Platform) 对话框随即打开。
c. 键入 x64 作为平台,然后单击“确定”(OK)
9. 单击“构建”(Build) > “重建解决方案”(Rebuild Solution)
应用程序应成功构建,没有任何错误。这将创建名为 pt_inst_test.dllCreo TOOLKIT DLL 文件。如果失败,请检查步骤 7 中在 makefile 内设置的 Creo TOOLKIT 安装目录的路径是否正确。
10. install_test 目录中,创建名为 creotk.dat 的文本文件。此注册表文件提供了有关 Creo TOOLKIT 应用程序的 Creo Parametric 信息。creotk.dat 文件应包含下列文本行:
name install_test
startup dll
exec_file pt_inst_test.dll
text_dir <creo_toolkit_loadpoint>/protk_appls/pt_install_test
end
11. 从包含 creotk.dat 文件的目录运行 Creo ParametricCreo TOOLKIT 应用程序在 Creo Parametric 功能区用户界面上“主页”(Home) 选项卡中的 TOOLKIT 组内的“文件”(File) > “工具”(Tools) 菜单下添加“安装测试”(Install Test) 命令。
如果发生错误,或者如果 Creo TOOLKIT 命令未出现在 Creo Parametric TOOLKIT 组中,请核对您所运行的 Creo Parametric 版本是否包括 Creo TOOLKIT 许可证。
12. 单击“工具”(Tools),然后单击“文件”(File) > “安装测试”(Install Test)Creo TOOLKIT “安装测试结果”(Install Test Results) 消息窗口随即打开,指示安装测试已成功。
这对您有帮助吗?