diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..50d75bc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Creo 7.0 Pro/TOOLKIT SDK (third-party, ~390MB, not part of source) +sdk7/ diff --git a/Res_center.dll b/Res_center.dll new file mode 100644 index 0000000..5c0591d Binary files /dev/null and b/Res_center.dll differ diff --git a/Res_center_80.dll b/Res_center_80.dll deleted file mode 100644 index 655c2da..0000000 Binary files a/Res_center_80.dll and /dev/null differ diff --git a/build.bat b/build.bat index 970600f..41aed43 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,11 @@ @echo off -set PROTOOL_SRC=C:\PROGRA~1\PTC\CREO80~1.0\COMMON~1\PROTOO~1 -set PROTOOL_SYS=%PROTOOL_SRC%\x86e_win64 +rem Creo 7.0 SDK first (covers Creo 7.0~10.0), fallback to Creo 8.0 SDK +if exist "%~dp0sdk7\protoolkit\includes" ( + set "PROTOOL_SRC=%~dp0sdk7\protoolkit" +) else ( + set "PROTOOL_SRC=C:\PROGRA~1\PTC\CREO80~1.0\COMMON~1\PROTOO~1" +) +set "PROTOOL_SYS=%PROTOOL_SRC%\x86e_win64" call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" diff --git a/configen.exe b/configen.exe index 42f7476..a1a5366 100644 Binary files a/configen.exe and b/configen.exe differ diff --git a/makefile_short b/makefile_short index 2bf1163..ab0c3a8 100644 --- a/makefile_short +++ b/makefile_short @@ -4,19 +4,19 @@ MAKEFILENAME = makefile_short PRO_MACHINE_TYPE = x86e_win64 !ifndef PROTOOL_SRC -PROTOOL_SRC = C:\PROGRA~1\PTC\CREO80~1.0\COMMON~1\PROTOO~1 +PROTOOL_SRC = D:\A开发型项目\AI_Agent相关开发\Res_center\sdk7\protoolkit !endif !ifndef PROTOOL_SYS PROTOOL_SYS = $(PROTOOL_SRC)\$(PRO_MACHINE_TYPE) !endif -EXE_DLL = Res_center_80.dll +EXE_DLL = Res_center.dll INCS = -I.\include -I$(PROTOOL_SRC)\includes -I$(PROTOOL_SRC)\protk_appls\includes CC = cl MACH = -DPRO_MACHINE=36 -DPRO_OS=4 -CCFLAGS = -c -GS -fp:precise -D_WSTDIO_DEFINED /utf-8 +CCFLAGS = -c -GS -fp:precise -D_WSTDIO_DEFINED /utf-8 /wd4828 CFLAGS = $(CCFLAGS) $(INCS) $(MACH) PTCLIBS_DLL = $(PROTOOL_SYS)\obj\protk_dll_NU.lib \ diff --git a/protk.dat b/protk.dat index de35822..c28047c 100644 --- a/protk.dat +++ b/protk.dat @@ -1,6 +1,6 @@ NAME Resource_Library -EXEC_FILE D:\A¿ª·¢ÐÍÏîĿ\AI_AgentÏà¹ؿª·¢\Res_center\Res_center_80.dll +EXEC_FILE D:\A¿ª·¢ÐÍÏîĿ\AI_AgentÏà¹ؿª·¢\Res_center\Res_center.dll TEXT_DIR D:\A¿ª·¢ÐÍÏîĿ\AI_AgentÏà¹ؿª·¢\Res_center\text STARTUP dll -REVISION 36 +REVISION 18 END diff --git a/src/assembly.c b/src/assembly.c index c275008..5c67941 100644 --- a/src/assembly.c +++ b/src/assembly.c @@ -14,8 +14,8 @@ #define IDC_RX 204 #define IDC_RY 205 #define IDC_RZ 206 -#define IDOK 207 -#define IDCANCEL 208 +#define RC_IDOK 207 +#define RC_IDCANCEL 208 #define PARAM_DW 320 #define PARAM_DH 320 #define WC_PARAM L"RCv62Param" @@ -151,8 +151,8 @@ static void param_create_controls(HWND hDlg) SendMessageW(ctrl, WM_SETFONT, (WPARAM)gParamFont, 1); y += dy + 12; - CreateWindowW(L"BUTTON", L"\u786e\u5b9a", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 100, y, 80, 26, hDlg, (HMENU)IDOK, NULL, NULL); - CreateWindowW(L"BUTTON", L"\u53d6\u6d88", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 190, y, 80, 26, hDlg, (HMENU)IDCANCEL, NULL, NULL); + CreateWindowW(L"BUTTON", L"\u786e\u5b9a", WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 100, y, 80, 26, hDlg, (HMENU)RC_IDOK, NULL, NULL); + CreateWindowW(L"BUTTON", L"\u53d6\u6d88", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 190, y, 80, 26, hDlg, (HMENU)RC_IDCANCEL, NULL, NULL); } static LRESULT CALLBACK ParamWndProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -162,12 +162,12 @@ static LRESULT CALLBACK ParamWndProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM param_create_controls(hDlg); return 0; case WM_COMMAND: - if (LOWORD(wParam) == IDOK) { + if (LOWORD(wParam) == RC_IDOK) { param_apply_matrix(hDlg); DestroyWindow(hDlg); return 0; } - if (LOWORD(wParam) == IDCANCEL) { + if (LOWORD(wParam) == RC_IDCANCEL) { make_identity(gParamMatrix); DestroyWindow(hDlg); return 0; diff --git a/tools/configen.c b/tools/configen.c index f40e438..e9fce59 100644 --- a/tools/configen.c +++ b/tools/configen.c @@ -39,10 +39,10 @@ static void GenerateProtk(char* buf, int sz) char dir[MAX_PATH]; GetExeDir(dir, sizeof(dir)); snprintf(buf, sz, "NAME Resource_Library\r\n" - "EXEC_FILE %s\\Res_center_80.dll\r\n" + "EXEC_FILE %s\\Res_center.dll\r\n" "TEXT_DIR %s\\text\r\n" "STARTUP dll\r\n" - "REVISION 36\r\n" + "REVISION 18\r\n" "END\r\n", dir, dir); } diff --git a/tools/configen.exe b/tools/configen.exe index 42f7476..a1a5366 100644 Binary files a/tools/configen.exe and b/tools/configen.exe differ diff --git a/开发技术文档_V1.2.txt b/开发技术文档_V1.2.txt index fa10a30..1854cad 100644 --- a/开发技术文档_V1.2.txt +++ b/开发技术文档_V1.2.txt @@ -9,7 +9,7 @@ 类型:Creo Pro/TOOLKIT DLL 插件 功能:标准件库浏览、3D 预览、搜索过滤、快速装配、LIC 授权 语言:C (核心) + C++ (preview.cpp) -编译器:MSVC 2022 | SDK:Creo 8.0 PTK | 平台:Win10/11 x64 | Creo 7.0+ +编译器:MSVC 2022 | SDK:Creo 7.0 PTK(最低目标版本,兼容 7.0~10.0)| 平台:Win10/11 x64 | Creo 7.0~10.0 二、源文件 @@ -77,15 +77,43 @@ 参数对话框无确定按钮 → 英文→中文,对话框加高 搜索框上边框缺失 → WS_EX_CLIENTEDGE 替换 WS_BORDER Insert 按钮中文被截 → 200×50 加宽居中 + Creo 7.0 加载失败 → protk.dat REVISION 36→18(36 会被 7.0 判为 + 要求 8.0),并以 Creo 7.0 SDK 重新编译 DLL -七、工具说明 +七、 工具说明 -------------------------------------------------- tools\keygen_lic.exe LIC授权文件生成器(Metro暗色UI + 背景音乐) tools\configen.exe protk.dat自动配置器(一键生成) 部署时放在DLL同目录运行 +====================================================================== + 八、版本兼容策略(Creo 7.0~10.0 / Win10~11) +====================================================================== + 【8.1】protk.dat 的 REVISION 含义 + Creo 加载器在启动辅助应用程序前检查 REVISION:值过大(如 36 对 + 应"要求 Creo 8.0")时,旧版本 Creo 直接拒绝加载并提示 + "应用程序需要 Creo X;当前版本为 Creo Y"。 + 官方 Creo 8.0 自带安装自检样例(pt_inst_test)即使用 REVISION 18, + 该值被 7.0~10.0 全系接受,为通用兼容值。 + + 【8.2】SDK 选择 + PTC 兼容规则:旧版 SDK 编译的应用程序可在新版 Creo 中运行 + (Creo 版本新于 TOOLKIT 版本 = 支持;反之不支持)。 + 故以 7.0 Pro/TOOLKIT 编译一份 DLL 即可覆盖 7.0~10.0。 + 源码只用 ProPartTessellate / ProAsmcompAssemble / ProFamtable 等 + 7.0 已有的稳定 API,无 8.0 专有调用,7.0 SDK 可直接编译。 + + 【8.3】运行时依赖 + ucore68.dll / udata68.dll 与 DLL 同目录部署;跨版本部署时从目标机 + Creo 的 Common Files\x86e_win64\obj 复制同名文件,避免混用。 + + 【8.4】编译方法 + makefile_short 的 PROTOOL_SRC 指向 Creo 7.0 的 ProTOOLKIT 目录后 + 运行 build.bat(nmake),产物 Res_center.dll(版本中立命名)。 + + ====================================================================== 附录A:组件替换开发记录(已暂停) ====================================================================== diff --git a/部署指南_V1.2.txt b/部署指南_V1.2.txt index 4002d0a..75bb30d 100644 --- a/部署指南_V1.2.txt +++ b/部署指南_V1.2.txt @@ -13,7 +13,7 @@ 二、部署文件清单 -------------------------------------------------- D:\ResLib\ - ├── Res_center_80.dll ← 核心 DLL(必须) + ├── Res_center.dll ← 核心 DLL(必须,Creo 7.0~10.0 通用) ├── protk.dat ← Creo 插件注册文件(必须) ├── ucore68.dll ← Creo 运行时依赖(必须) ├── udata68.dll ← Creo 运行时依赖(必须) @@ -79,10 +79,10 @@ 七、常见问题 -------------------------------------------------- Q1: 启动提示"无法加载辅助应用程序" -A1: 检查 protk.dat 路径和 REVISION=36,或用 configen.exe 重新生成 +A1: 检查 protk.dat 路径与 REVISION=18(通用兼容值),或用 configen.exe 重新生成 Q2: 点击按钮无反应 -A2: 确保 ucore68.dll、udata68.dll 与 DLL 同目录 +A2: 确保 ucore68.dll、udata68.dll 与 DLL 同目录;若跨 Creo 版本部署,建议直接复制目标机 Creo 安装目录 Common Files\x86e_win64\obj 下的同名文件,避免版本混用 Q3: 3D 预览空白 A3: 显卡需支持 OpenGL(Windows 自带即可) @@ -93,7 +93,18 @@ A4: 检查 config\lic\res_center.lic 是否存在且内容正确 Q5: 如何更新标准件库 A5: 直接在 Resource_Library 下增删 .prt/.asm 或目录,无需维护 .mnu +Q6: 支持哪些 Creo 版本?支持 Win11 吗? +A6: Creo 7.0 / 8.0 / 9.0 / 10.0(64位)均支持。DLL 基于 Creo 7.0 的 + Pro/TOOLKIT 编译(PTC 兼容规则:旧版 SDK 编译的应用程序可在新版 + Creo 中运行),因此一份 Res_center.dll 通用于 7.0~10.0。 + Windows 10 / 11(64位)均支持。 + +Q7: 提示"应用程序需要 Creo 8.0;当前版本为 Creo 7.0" +A7: 旧版 protk.dat 中 REVISION=36 会被 Creo 7.0 判定为要求 Creo 8.0。 + 使用新版 configen.exe 重新生成 protk.dat(REVISION=18,Creo 全系 + 通用兼容值),或手动把该行改为 REVISION 18 后重新启动辅助应用程序。 + 八、版本信息 -------------------------------------------------- -版本:V1.2 | DLL:Res_center_80.dll | 兼容:Creo 7.0~10.0 +版本:V1.3 | DLL:Res_center.dll | 兼容:Creo 7.0~10.0(Win10/11 x64)