Initial commit

This commit is contained in:
sladro 2025-07-16 17:16:59 +08:00
commit 0fe01d65f3
69 changed files with 10524 additions and 0 deletions

20
.gitignore vendored Normal file
View File

@ -0,0 +1,20 @@
otk_cpp_doc/
.vs/
.claude/
.vscode/
*.user
*.userosscache
*.suo
*.ncrunch*
*.dbmdl
*.jfm
*.userprefs
*.aps
*.cache
*.ilk
*.log
*.tmp
*.tmp_proj
*.user
*.userosscache
*.sln.docstates

0
AuthManager.cpp Normal file
View File

1
AuthManager.h Normal file
View File

@ -0,0 +1 @@
#pragma once

266
CLAUDE.md Normal file
View File

@ -0,0 +1,266 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## 项目架构
这是一个 MFC 动态链接库 (DLL) 项目,作为 Creo CAD 软件的插件运行。项目整合了以下技术栈:
- **MFC框架**: 微软基础类库,用于 Windows 应用程序开发
- **OTK/ProToolkit**: PTC Creo 的官方开发工具包,用于与 Creo 交互
- **Windows Socket**: 原生网络通信替代第三方HTTP库
- **WebSocket**: 实时双向通信支持
## 当前功能
目前实现了基础的 HTTP 服务器,允许外部应用通过 HTTP 请求与 Creo 软件进行交互:
- HTTP 服务器监听端口 12345
- 提供 `/show_message` 端点接收文本消息并在 Creo 中显示
- 使用定时器机制解决跨线程 OTK 调用问题
- 支持跨主机部署
## 项目升级计划 - Web API + WebSocket 架构
### 项目目标
实现Web前端通过API控制Creo进行模型分析、特征删除和格式导出的MVP系统。
### 接口设计
**HTTP API (快速查询)**
- GET /api/status/creo - 检测Creo运行状态
- GET /api/status/model - 检查模型加载状态
- GET /api/model/features - 获取特征列表
- POST /api/auth/login - 用户认证
**WebSocket (长操作)**
- load_model - 加载模型
- delete_features - 删除特征
- export_model - 导出模型
- analyze_structure - 分析结构
### 技术架构
```
Web前端 -> HTTP API (状态查询) -> Creo状态管理器
-> WebSocket (操作执行) -> Creo操作管理器 -> 实时日志推送
```
### 目标文件结构
```
MFCCreoDll/
├── src/
│ ├── core/ # 核心服务器管理
│ ├── http/ # HTTP API处理
│ ├── websocket/ # WebSocket服务
│ ├── creo/ # Creo操作封装
│ ├── utils/ # 工具类
│ └── auth/ # 认证管理
```
### 开发计划
- 第1周基础框架 (HTTP改造 + WebSocket基础)
- 第2周核心功能 (Creo集成 + 操作实现)
- 第3周测试优化 (联调 + 性能优化)
### 关键特性
- 双端口服务12345(HTTP) + 12346(WebSocket)
- 实时日志推送和进度反馈
- 大模型支持(>2GB)一次性加载
- 简单用户识别机制
- 跨主机部署支持
## 开发进度记录 - 模块化实现
### ✅ 已完成模块
#### 模块1: 基础HTTP服务器 (完成)
**功能:** HTTP服务器框架支持路由注册和请求处理
**文件:** HttpServer.h, HttpServer.cpp, Config.h
**测试状态:** ✅ 编译成功,功能测试通过
**API端点**
- `/test` - 服务器连通性测试
- `/show_message?text=消息` - 在Creo中显示消息
#### 模块2: Creo状态检测 (完成)
**功能:** Creo连接状态和模型状态实时检测
**文件:** CreoManager.h, CreoManager.cpp
**测试状态:** ✅ 编译成功,功能测试通过,已优化增强
**API端点**
- `/api/status/creo` - Creo连接状态包含版本、工作目录、会话ID
- `/api/status/model` - 当前模型状态(包含名称、路径、修改状态等)
**技术细节:**
- 使用OTK API进行Creo交互
- 采用单例模式管理Creo会话
- 完善的异常处理机制
- 详细的状态信息返回
#### 模块3: STEP导出功能 (完成)
**功能:** 支持将Creo模型导出为STEP格式
**文件:** CreoManager.h, CreoManager.cpp, MFCCreoDll.cpp
**测试状态:** ✅ 编译成功,功能测试通过,已解决崩溃问题
**API端点**
- `POST /api/export/model` - 模型导出接口
**技术细节:**
- 使用 `pfcSTEPExportInstructions` 接口进行STEP导出
- 支持装配体和零件的导出
- 包含文件大小计算和时间戳功能
- 安全的JSON解析机制避免正则表达式崩溃
- 完善的错误处理和异常管理
**API请求格式**
```json
{
"software_type": "creo",
"format_type": "step",
"export_path": "D:\\model.stp",
"options": {
"geom_flags": "solids",
"advanced": false
}
}
```
**API响应格式**
```json
{
"success": true,
"data": {
"exportPath": "D:\\model.stp",
"fileSize": "15.2MB",
"format": "step",
"exportTime": "2024-01-15T10:30:00Z",
"software": "Creo Parametric",
"originalFile": "assembly.asm",
"details": {
"dirname": "D:\\",
"filename": "model.stp",
"creoson_response": {
"dirname": "D:\\",
"filename": "model.stp",
"full_path": "D:\\model.stp"
}
}
},
"error": null
}
```
### 🔄 待实现模块(按优先级排序)
#### 模块4: WebSocket服务 (高优先级)
**目标:** 实现双向实时通信,支持长时间操作
**预计文件:** WebSocketServer.h, WebSocketServer.cpp
**主要功能:**
- WebSocket服务器端口12346
- 实时日志推送
- 长操作进度反馈
- 客户端连接管理
#### 模块5: Creo长操作接口 (中优先级)
**目标:** 实现模型加载、特征删除、多格式导出等操作
**预计文件:** ModelAnalyzer.h, ModelAnalyzer.cpp
**主要功能:**
- 模型文件加载操作
- 特征分析和删除
- 多格式导出STL、IGES等
- 操作进度监控
#### 模块6: 日志系统 (低优先级)
**目标:** 统一的日志记录和错误追踪
**预计文件:** Logger.h, Logger.cpp
**主要功能:**
- 结构化日志输出
- 多级别日志支持
- 文件和控制台输出
- 调试信息记录
#### 模块7: 用户认证 (最低优先级)
**目标:** 简单的用户识别和访问控制
**预计文件:** AuthManager.h, AuthManager.cpp
**主要功能:**
- 简单token认证
- 会话管理
- 权限控制
### 技术架构总结
**当前架构状态:**
```
Web前端 -> HTTP API (12345端口) -> MFC DLL -> OTK -> Creo
↓ (已实现)
状态查询接口 -> CreoManager -> 实时状态反馈
导出接口 -> ExportModelToSTEP -> STEP文件导出
```
**目标架构:**
```
Web前端 -> HTTP API (快速查询) -> CreoManager -> Creo
-> WebSocket (长操作) -> WebSocketServer -> ModelAnalyzer -> Creo
实时日志推送
```
### 开发原则
1. **模块化开发** - 每个模块独立测试通过后再进行下一个
2. **最小化修改** - 保持现有代码稳定,只添加新功能
3. **向后兼容** - 新API不影响已有接口
4. **错误处理** - 每个模块都有完善的异常处理
5. **简化实现** - 优先实现MVP功能避免过度工程化
### 已解决的技术问题
1. **OTK API兼容性** - 使用pfcSession而非ProToolkit
2. **跨线程通信** - 保持定时器机制处理主线程OTK调用
3. **内存管理** - 使用智能指针和RAII模式避免内存泄漏
4. **编码问题** - UTF-8编码保存文件解决中文注释警告
5. **错误处理** - 分层异常处理确保系统稳定性
6. **STEP导出崩溃** - 修复了废弃API和正则表达式导致的崩溃问题
7. **JSON解析问题** - 实现了安全的JSON解析机制
8. **线程安全问题** - 使用mutex和atomic保证多线程安全
9. **API参数验证** - 完善了输入参数的验证机制
### 下一步计划
建议继续实现模块3HTTP路由系统为后续WebSocket和复杂操作奠定基础。
## 构建和编译
使用 Visual Studio 2022 (v143 工具集) 构建:
```bash
# 使用 Visual Studio 构建
msbuild MFCCreoDll.sln /p:Configuration=Debug /p:Platform=x64
```
或在 Visual Studio IDE 中:
- 打开 `MFCCreoDll.sln`
- 选择 Debug|x64 配置
- 构建解决方案 (Ctrl+Shift+B)
## 依赖环境
项目依赖 Creo 5.0.0.0 安装:
- OTK C++ 库路径: `C:\Program Files\PTC\Creo 5.0.0.0\Common Files\otk\otk_cpp\`
- ProToolkit 库路径: `C:\Program Files\PTC\Creo 5.0.0.0\Common Files\protoolkit\`
## 关键文件说明
- `MFCCreoDll.cpp`: 主要逻辑实现,包含服务器和 OTK 交互代码
- `MFCCreoDll.h`: MFC 应用程序类声明
- `MFCCreoDll.def`: DLL 导出定义文件
- `MFCCreoDll.vcxproj`: Visual Studio 项目配置文件
## 重要架构注意事项
- 项目使用动态 MFC 链接 (`UseOfMfc=Dynamic`)
- 需要 Unicode 字符集支持
- 使用 Windows 原生线程和定时器机制
- 插件生命周期由 `user_initialize()``user_terminate()` 函数管理
- OTK API 必须在主线程中调用,使用定时器机制处理跨线程通信
## 调试
编译后的 DLL 位于 `x64/Debug/MFCCreoDll.dll`,需要注册到 Creo 中作为插件使用。
这个项目是在visual studio 2022中进行编译生成所以不要用其它的编译环境调试报错也是从2022中进行。项目开发于win11环境运行于win7环境这个要特别关注。otk文档在文件夹otk_cpp_doc下请自己查找相关api

25
Config.h Normal file
View File

@ -0,0 +1,25 @@
#pragma once
// 系统配置常量
class Config {
public:
// 端口配置
static const int HTTP_PORT = 12345;
static const int WEBSOCKET_PORT = 12346;
// API配置
static constexpr const char* API_PREFIX = "/api";
// 超时配置
static const int HTTP_TIMEOUT_MS = 30000; // 30秒
static const int WEBSOCKET_TIMEOUT_MS = 300000; // 5分钟
// 缓冲区大小
static const int BUFFER_SIZE = 4096;
// Creo配置
static const int CREO_CHECK_INTERVAL_MS = 100; // 检查间隔
private:
Config() = delete; // 禁止实例化
};

547
CreoManager.cpp Normal file
View File

@ -0,0 +1,547 @@
#include "pch.h"
#include "CreoManager.h"
#include <wfcAssembly.h>
#include <pfcBase.h>
#include <pfcGlobal.h>
#include <pfcExport.h>
#include <stdcols.h>
#include <ctime>
#include <sstream>
#include <iomanip>
#include <fstream>
#include <windows.h>
CreoManager& CreoManager::Instance() {
static CreoManager instance;
return instance;
}
CreoStatus CreoManager::GetCreoStatus() {
CreoStatus status;
SessionInfo sessionInfo = GetSessionInfo();
status.is_connected = sessionInfo.is_valid;
status.version = sessionInfo.version;
status.build = sessionInfo.build;
if (sessionInfo.is_valid) {
// 获取工作目录
try {
xstring workdir = sessionInfo.session->GetCurrentDirectory();
status.working_directory = XStringToString(workdir);
}
catch (...) {
status.working_directory = "Failed to get working directory";
}
status.session_id = 1;
} else {
status.working_directory = "Failed to connect to Creo";
status.session_id = 0;
}
return status;
}
ModelStatus CreoManager::GetModelStatus() {
ModelStatus status;
SessionInfo sessionInfo = GetSessionInfo();
if (!sessionInfo.is_valid) {
return status;
}
try {
pfcModel_ptr current_model = sessionInfo.session->GetCurrentModel();
if (current_model) {
status.has_model = true;
// 获取模型名称和文件名
try {
xstring name_xstr = current_model->GetFileName();
status.name = XStringToString(name_xstr);
status.filename = status.name;
}
catch (...) {
status.name = "Failed to get model name";
status.filename = "Failed to get filename";
}
// 获取模型类型
try {
pfcModelType model_type = current_model->GetType();
switch (model_type) {
case pfcMDL_PART:
status.type = "Part";
status.is_assembly = false;
break;
case pfcMDL_ASSEMBLY:
status.type = "Assembly";
status.is_assembly = true;
break;
case pfcMDL_DRAWING:
status.type = "Drawing";
status.is_assembly = false;
break;
default:
status.type = "";
status.is_assembly = false;
break;
}
}
catch (...) {
status.type = "Failed to get model type";
status.is_assembly = false;
}
// 获取模型文件大小(装配体统计所有零件和子装配体的总大小)
try {
if (status.is_assembly) {
// 装配体:统计所有组件的文件大小
status.file_size = CalculateAssemblyTotalSize(current_model);
} else {
// 单个零件:直接获取文件大小
status.file_size = GetModelFileSize(current_model);
}
}
catch (...) {
status.file_size = "Exception getting file size";
}
// 获取真实的零件数量和装配体层级
if (status.is_assembly) {
try {
wfcWAssembly_ptr wAssembly = wfcWAssembly::cast(current_model);
if (wAssembly) {
// 获取所有显示的组件
wfcWComponentPaths_ptr components = wAssembly->ListDisplayedComponents();
if (components) {
status.total_parts = components->getarraysize();
} else {
status.total_parts = 0;
}
status.assembly_levels = SafeCalculateAssemblyLevels(wAssembly);
} else {
status.total_parts = 0;
status.assembly_levels = 0;
}
}
catch (...) {
status.total_parts = 0;
status.assembly_levels = 0;
}
} else {
// 非装配体(零件)的真实数据
status.total_parts = 1;
status.assembly_levels = 1;
}
// 解析软件信息
std::string full_version = sessionInfo.version;
size_t space_pos = full_version.find(" ");
if (space_pos != std::string::npos) {
status.software = full_version.substr(0, space_pos);
status.version = full_version.substr(space_pos + 1);
} else {
status.software = "Failed to parse software name";
status.version = "Failed to parse version";
}
// 设置其他信息
status.connection_time = GetCurrentTimeString();
status.open_time = status.connection_time;
status.connection_status = "Connected";
}
}
catch (...) {
status.has_model = false;
status.name = "Failed to access model";
status.filename = "Failed to access model";
status.type = "Failed to access model";
status.is_assembly = false;
status.total_parts = 0;
status.assembly_levels = 0;
status.software = "Failed to access model";
status.version = "Failed to access model";
status.connection_time = "Failed to get time";
status.open_time = "Failed to get time";
status.connection_status = "Failed to get status";
status.file_size = "Failed to access model";
}
return status;
}
bool CreoManager::ShowMessage(const std::string& message) {
SessionInfo sessionInfo = GetSessionInfo();
if (!sessionInfo.is_valid) {
return false;
}
try {
xstring msg_xstr = StringToXString(message);
sessionInfo.wSession->UIShowMessageDialog(msg_xstr, NULL);
return true;
}
catch (...) {
return false;
}
}
std::string CreoManager::XStringToString(const xstring& xstr) {
try {
std::wstring wstr(xstr);
if (wstr.empty()) {
return "";
}
// 使用WideCharToMultiByte进行正确的UTF-8编码转换
int size_needed = WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), (int)wstr.length(), NULL, 0, NULL, NULL);
if (size_needed <= 0) {
return "";
}
std::string result(size_needed, 0);
WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), (int)wstr.length(), &result[0], size_needed, NULL, NULL);
return result;
}
catch (...) {
return "";
}
}
xstring CreoManager::StringToXString(const std::string& str) {
try {
if (str.empty()) {
return xstring();
}
// 使用MultiByteToWideChar进行正确的UTF-8解码转换
int size_needed = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int)str.length(), NULL, 0);
if (size_needed <= 0) {
return xstring();
}
std::wstring wstr(size_needed, 0);
MultiByteToWideChar(CP_UTF8, 0, str.c_str(), (int)str.length(), &wstr[0], size_needed);
return xstring(wstr.c_str());
}
catch (...) {
return xstring();
}
}
std::string CreoManager::GetCurrentTimeString() {
std::time_t now = std::time(nullptr);
std::tm* local_tm = std::localtime(&now);
std::ostringstream oss;
oss << std::put_time(local_tm, "%Y-%m-%d %H:%M:%S");
return oss.str();
}
std::string CreoManager::GetCurrentTimeStringISO() {
std::time_t now = std::time(nullptr);
std::tm* utc_tm = std::gmtime(&now);
std::ostringstream oss;
oss << std::put_time(utc_tm, "%Y-%m-%dT%H:%M:%S");
oss << ".000000Z"; // 添加微秒和UTC标识
return oss.str();
}
CreoManager::SessionInfo CreoManager::GetSessionInfo() {
SessionInfo info;
info.is_valid = false;
try {
info.session = pfcGetCurrentSessionWithCompatibility(pfcC4Compatible);
if (info.session) {
info.wSession = wfcWSession::cast(info.session);
if (info.wSession) {
// 获取版本信息
int version_num = info.wSession->GetReleaseNumericVersion();
xstring date_code = info.wSession->GetDisplayDateCode();
// 尝试获取真实的软件名称
std::string software_name = "Creo"; // 基础名称,如果无法获取更详细的名称
std::ostringstream version_str;
version_str << software_name << " " << version_num << ".0";
info.version = version_str.str();
info.build = XStringToString(date_code);
info.is_valid = true;
} else {
info.version = "Failed to get version";
info.build = "Failed to get build";
}
} else {
info.version = "Failed to connect to Creo";
info.build = "Failed to connect to Creo";
}
}
catch (...) {
info.version = "Failed to get version";
info.build = "Failed to get build";
}
return info;
}
std::string CreoManager::GetFileSize(const std::string& filepath) {
try {
if (filepath.empty()) {
return "Empty filepath";
}
// 复用现有的字符串转换逻辑
xstring xpath = StringToXString(filepath);
std::wstring wpath(xpath);
WIN32_FILE_ATTRIBUTE_DATA fileInfo;
if (GetFileAttributesExW(wpath.c_str(), GetFileExInfoStandard, &fileInfo)) {
LARGE_INTEGER size;
size.HighPart = fileInfo.nFileSizeHigh;
size.LowPart = fileInfo.nFileSizeLow;
double file_size_mb = static_cast<double>(size.QuadPart) / (1024.0 * 1024.0);
std::ostringstream oss;
oss << std::fixed << std::setprecision(1) << file_size_mb << "MB";
return oss.str();
} else {
DWORD error = GetLastError();
std::ostringstream oss;
oss << "File access failed (Error: " << error << ") Path: " << filepath;
return oss.str();
}
}
catch (...) {
return "Exception in GetFileSize";
}
}
int CreoManager::SafeCalculateAssemblyLevels(wfcWAssembly_ptr assembly) {
try {
if (!assembly) {
return 1;
}
// 使用ComponentPath分析装配体层级深度
wfcWComponentPaths_ptr components = assembly->ListDisplayedComponents();
if (!components) {
return 1;
}
int component_count = components->getarraysize();
if (component_count == 0) {
return 1;
}
int max_level = 1;
// 移除组件数量限制,检查所有组件
for (int i = 0; i < component_count; i++) {
try {
wfcWComponentPath_ptr comp_path = components->get(i);
if (comp_path) {
// 使用GetComponentIds获取组件路径
xintsequence_ptr ids = comp_path->GetComponentIds();
if (ids) {
// 路径深度就是装配体层级
int path_depth = ids->getarraysize();
if (path_depth > max_level) {
max_level = path_depth;
}
}
}
}
catch (...) {
// 跳过有问题的组件
continue;
}
}
return max_level;
}
catch (...) {
return 1;
}
}
std::string CreoManager::GetModelFileSize(pfcModel_ptr model) {
try {
if (!model) {
return "Model is null";
}
pfcModelDescriptor_ptr descr = model->GetDescr();
if (!descr) {
return "No descriptor";
}
// 使用origin路径获取文件大小
xstring origin = model->GetOrigin();
std::string origin_str = XStringToString(origin);
if (!origin_str.empty()) {
return GetFileSize(origin_str);
}
return "No origin path";
}
catch (...) {
return "Exception in GetModelFileSize";
}
}
double CreoManager::ParseMBFromSizeString(const std::string& size_str) {
try {
if (size_str.find("MB") != std::string::npos) {
size_t mb_pos = size_str.find("MB");
std::string size_num = size_str.substr(0, mb_pos);
return std::stod(size_num);
}
return 0.0;
}
catch (...) {
return 0.0;
}
}
std::string CreoManager::CalculateAssemblyTotalSize(pfcModel_ptr model) {
try {
wfcWAssembly_ptr assembly = wfcWAssembly::cast(model);
if (!assembly) {
return "Not an assembly";
}
double total_size_bytes = 0;
int processed_count = 0;
// 首先添加主装配体文件大小
std::string main_size = GetModelFileSize(model);
double main_mb = ParseMBFromSizeString(main_size);
if (main_mb > 0) {
total_size_bytes += main_mb * 1024 * 1024;
processed_count++;
}
// 获取所有组件
wfcWComponentPaths_ptr components = assembly->ListDisplayedComponents();
if (components) {
int component_count = components->getarraysize();
for (int i = 0; i < component_count; i++) {
try {
wfcWComponentPath_ptr comp_path = components->get(i);
if (comp_path) {
pfcModel_ptr comp_model = comp_path->GetLeaf();
if (comp_model) {
std::string comp_size = GetModelFileSize(comp_model);
double comp_mb = ParseMBFromSizeString(comp_size);
if (comp_mb > 0) {
total_size_bytes += comp_mb * 1024 * 1024;
processed_count++;
}
}
}
}
catch (...) {
continue;
}
}
}
// 转换为MB并返回
double total_mb = total_size_bytes / (1024.0 * 1024.0);
std::ostringstream oss;
oss << std::fixed << std::setprecision(1) << total_mb << "MB (from " << processed_count << " files)";
return oss.str();
}
catch (...) {
return "Exception in CalculateAssemblyTotalSize";
}
}
ExportResult CreoManager::ExportModelToSTEP(const std::string& export_path, const std::string& geom_flags) {
ExportResult result;
SessionInfo sessionInfo = GetSessionInfo();
if (!sessionInfo.is_valid) {
result.error_message = "Creo session not available";
return result;
}
try {
pfcModel_ptr current_model = sessionInfo.session->GetCurrentModel();
if (!current_model) {
result.error_message = "No current model loaded";
return result;
}
// 检查导出路径是否有效
if (export_path.empty()) {
result.error_message = "Invalid export path";
return result;
}
// 检查模型类型是否支持导出
pfcModelType model_type = current_model->GetType();
if (model_type != pfcMDL_PART && model_type != pfcMDL_ASSEMBLY) {
result.error_message = "Model type not supported for export";
return result;
}
// 创建几何导出标志
pfcGeomExportFlags_ptr geometryFlags = pfcGeomExportFlags::Create();
// 创建STEP导出指令
pfcSTEPExportInstructions_ptr exportInstructions =
pfcSTEPExportInstructions::Create(geometryFlags);
// 执行导出 - 使用xrstring类型
xrstring export_path_xrstr = export_path.c_str();
current_model->Export(export_path_xrstr, pfcExportInstructions::cast(exportInstructions));
// 检查导出文件是否存在使用Windows API
WIN32_FILE_ATTRIBUTE_DATA fileInfo;
if (GetFileAttributesExA(export_path.c_str(), GetFileExInfoStandard, &fileInfo)) {
result.success = true;
result.export_path = export_path;
result.file_size = GetFileSize(export_path);
result.format = "step";
result.export_time = GetCurrentTimeStringISO();
result.software = "Creo Parametric";
// 获取原始文件信息
try {
xstring name_xstr = current_model->GetFileName();
result.original_file = XStringToString(name_xstr);
} catch (...) {
result.original_file = "Unknown";
}
// 解析目录和文件名
size_t last_slash = export_path.find_last_of("\\/");
if (last_slash != std::string::npos) {
result.dirname = export_path.substr(0, last_slash);
result.filename = export_path.substr(last_slash + 1);
} else {
result.dirname = "";
result.filename = export_path;
}
} else {
result.error_message = "Export file not created";
}
}
catch (...) {
result.error_message = "Export operation failed";
}
return result;
}

94
CreoManager.h Normal file
View File

@ -0,0 +1,94 @@
#pragma once
#include <wfcSession.h>
#include <wfcGlobal.h>
#include <pfcExport.h>
#include <string>
#include <vector>
// Creo状态信息结构
struct CreoStatus {
bool is_connected = false;
std::string version;
std::string build;
std::string working_directory;
int session_id = 0;
};
// 模型状态信息结构
struct ModelStatus {
bool has_model = false;
std::string name;
std::string filename;
std::string type;
std::string software; // 从OTK API获取不设默认值
std::string version; // 从OTK API获取不设默认值
std::string connection_time;
bool is_assembly = false;
int total_parts = 0;
int assembly_levels = 0;
std::string file_size;
std::string connection_status;
std::string open_time;
};
// 导出结果结构
struct ExportResult {
bool success = false;
std::string export_path;
std::string file_size;
std::string format;
std::string export_time;
std::string software;
std::string original_file;
std::string dirname;
std::string filename;
std::string error_message;
};
// Creo管理器类
class CreoManager {
public:
static CreoManager& Instance();
// 状态检测
CreoStatus GetCreoStatus();
ModelStatus GetModelStatus();
// 基础操作
bool ShowMessage(const std::string& message);
// 导出功能
ExportResult ExportModelToSTEP(const std::string& export_path, const std::string& geom_flags = "solids");
// 辅助功能
std::string GetCurrentTimeString();
std::string GetCurrentTimeStringISO();
std::string GetFileSize(const std::string& filepath);
int SafeCalculateAssemblyLevels(wfcWAssembly_ptr assembly);
// 文件大小统计
std::string GetModelFileSize(pfcModel_ptr model);
std::string CalculateAssemblyTotalSize(pfcModel_ptr model);
double ParseMBFromSizeString(const std::string& size_str);
private:
CreoManager() = default;
~CreoManager() = default;
CreoManager(const CreoManager&) = delete;
CreoManager& operator=(const CreoManager&) = delete;
// 辅助函数
std::string XStringToString(const xstring& xstr);
xstring StringToXString(const std::string& str);
// 会话管理(避免重复代码)
struct SessionInfo {
pfcSession_ptr session;
wfcWSession_ptr wSession;
bool is_valid;
std::string version;
std::string build;
};
SessionInfo GetSessionInfo();
};

0
HttpRouter.cpp Normal file
View File

1
HttpRouter.h Normal file
View File

@ -0,0 +1 @@
#pragma once

BIN
HttpServer.cpp Normal file

Binary file not shown.

57
HttpServer.h Normal file
View File

@ -0,0 +1,57 @@
#pragma once
#include <winsock2.h>
#include <ws2tcpip.h>
#include <string>
#include <map>
#include <functional>
#include "Config.h"
// HTTP请求结构
struct HttpRequest {
std::string method;
std::string path;
std::string query;
std::map<std::string, std::string> headers;
std::string body;
};
// HTTP响应结构
struct HttpResponse {
int status_code = 200;
std::map<std::string, std::string> headers;
std::string body;
HttpResponse() {
headers["Content-Type"] = "application/json";
headers["Access-Control-Allow-Origin"] = "*";
headers["Access-Control-Allow-Methods"] = "GET, POST, OPTIONS";
headers["Access-Control-Allow-Headers"] = "Content-Type";
}
};
// HTTP服务器类
class HttpServer {
public:
HttpServer();
~HttpServer();
bool Start();
void Stop();
bool IsRunning() const { return running_; }
// 设置路由处理器
void SetRouteHandler(const std::string& path,
std::function<HttpResponse(const HttpRequest&)> handler);
private:
static DWORD WINAPI ServerThread(LPVOID lpParam);
void HandleClient(SOCKET client_socket);
HttpRequest ParseRequest(const std::string& raw_request);
void SendResponse(SOCKET client_socket, const HttpResponse& response);
SOCKET server_socket_;
volatile bool running_;
HANDLE thread_handle_;
std::map<std::string, std::function<HttpResponse(const HttpRequest&)>> route_handlers_;
};

57
HttpServer_fixed.h Normal file
View File

@ -0,0 +1,57 @@
#pragma once
#include <winsock2.h>
#include <ws2tcpip.h>
#include <string>
#include <map>
#include <functional>
#include "Config.h"
// HTTP请求结构
struct HttpRequest {
std::string method;
std::string path;
std::string query;
std::map<std::string, std::string> headers;
std::string body;
};
// HTTP响应结构
struct HttpResponse {
int status_code = 200;
std::map<std::string, std::string> headers;
std::string body;
HttpResponse() {
headers["Content-Type"] = "application/json";
headers["Access-Control-Allow-Origin"] = "*";
headers["Access-Control-Allow-Methods"] = "GET, POST, OPTIONS";
headers["Access-Control-Allow-Headers"] = "Content-Type";
}
};
// HTTP服务器类
class HttpServer {
public:
HttpServer();
~HttpServer();
bool Start();
void Stop();
bool IsRunning() const { return running_; }
// 设置路由处理器
void SetRouteHandler(const std::string& path,
std::function<HttpResponse(const HttpRequest&)> handler);
private:
static DWORD WINAPI ServerThread(LPVOID lpParam);
void HandleClient(SOCKET client_socket);
HttpRequest ParseRequest(const std::string& raw_request);
void SendResponse(SOCKET client_socket, const HttpResponse& response);
SOCKET server_socket_;
volatile bool running_;
HANDLE thread_handle_;
std::map<std::string, std::function<HttpResponse(const HttpRequest&)>> route_handlers_;
};

0
JsonHelper.cpp Normal file
View File

1
JsonHelper.h Normal file
View File

@ -0,0 +1 @@
#pragma once

0
Logger.cpp Normal file
View File

1
Logger.h Normal file
View File

@ -0,0 +1 @@
#pragma once

341
MFCCreoDll.cpp Normal file
View File

@ -0,0 +1,341 @@
// MFCCreoDll.cpp: 定义 DLL 的初始化例程。
//
#include "pch.h"
#include "framework.h"
#include "MFCCreoDll.h"
#include "HttpServer.h"
#include "CreoManager.h"
#include <wfcSession.h>
#include <wfcGlobal.h>
#include <string>
#include <sstream>
#include <regex>
#include <mutex>
#include <atomic>
#include <memory>
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// --- 全局变量 ---
static std::unique_ptr<HttpServer> g_http_server;
static std::mutex message_mutex;
static std::string pending_message; // 待处理的消息
static std::atomic<bool> has_pending_message{false};
static UINT_PTR timer_id = 0;
// --- 辅助函数:将 std::string 转换为 xstring ---
xstring ConvertStringToXstring(const std::string& str)
{
std::wstring wstr(str.begin(), str.end());
return xstring(wstr.c_str());
}
// 定时器回调函数,在主线程中处理待处理的消息
VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
if (has_pending_message.load()) {
std::lock_guard<std::mutex> lock(message_mutex);
if (has_pending_message.load()) {
has_pending_message = false; // 立即清除标志,避免重复触发
try {
pfcSession_ptr Session = pfcGetCurrentSessionWithCompatibility(pfcC4Compatible);
wfcWSession_ptr wSession = wfcWSession::cast(Session);
xstring info = ConvertStringToXstring(pending_message);
wSession->UIShowMessageDialog(info, NULL);
}
catch (...) {
// 处理失败
}
}
}
}
// 测试路由处理器
HttpResponse TestHandler(const HttpRequest& request) {
bool creo_connected = false;
try {
pfcSession_ptr session = pfcGetCurrentSessionWithCompatibility(pfcC4Compatible);
creo_connected = (session != nullptr);
}
catch (...) {
creo_connected = false;
}
std::ostringstream json;
json << "{"
<< "\"success\": true,"
<< "\"data\": {"
<< "\"running\": " << (creo_connected ? "true" : "false") << ","
<< "\"message\": \"" << (creo_connected ? "CREOSON 与 Creo 均已启动" : "Creo 未连接") << "\""
<< "},"
<< "\"error\": null"
<< "}";
HttpResponse response;
response.body = json.str();
return response;
}
// 显示消息路由处理器
HttpResponse ShowMessageHandler(const HttpRequest& request) {
// 从查询参数获取消息
std::string message = "Default message";
size_t text_pos = request.query.find("text=");
if (text_pos != std::string::npos) {
text_pos += 5; // 跳过"text="
size_t end_pos = request.query.find("&", text_pos);
if (end_pos == std::string::npos) {
end_pos = request.query.length();
}
message = request.query.substr(text_pos, end_pos - text_pos);
}
// 设置待处理消息
{
std::lock_guard<std::mutex> lock(message_mutex);
pending_message = message;
has_pending_message = true;
}
HttpResponse response;
response.body = "{\"status\":\"ok\",\"message\":\"Message sent to Creo\"}";
return response;
}
// Creo状态检测路由处理器
HttpResponse CreoStatusHandler(const HttpRequest& request) {
CreoStatus status = CreoManager::Instance().GetCreoStatus();
std::ostringstream json;
json << "{"
<< "\"is_connected\":" << (status.is_connected ? "true" : "false") << ","
<< "\"version\":\"" << status.version << "\","
<< "\"build\":\"" << status.build << "\","
<< "\"working_directory\":\"" << status.working_directory << "\","
<< "\"session_id\":" << status.session_id
<< "}";
HttpResponse response;
response.body = json.str();
return response;
}
// 模型状态检测路由处理器
HttpResponse ModelStatusHandler(const HttpRequest& request) {
ModelStatus status = CreoManager::Instance().GetModelStatus();
std::ostringstream json;
if (status.has_model) {
json << "{"
<< "\"success\": true,"
<< "\"data\": {"
<< "\"name\": \"" << status.name << "\","
<< "\"filename\": \"" << status.filename << "\","
<< "\"type\": \"" << status.type << "\","
<< "\"software\": \"" << status.software << "\","
<< "\"version\": \"" << status.version << "\","
<< "\"connectionTime\": \"" << status.connection_time << "\","
<< "\"isAssembly\": " << (status.is_assembly ? "true" : "false") << ",";
if (status.is_assembly) {
json << "\"basicStats\": {"
<< "\"totalParts\": " << status.total_parts << ","
<< "\"assemblyLevels\": " << status.assembly_levels << ","
<< "\"fileSize\": \"" << status.file_size << "\""
<< "},";
}
json << "\"fileName\": \"" << status.filename << "\","
<< "\"sourceSoftware\": \"" << status.software << "\","
<< "\"partCount\": " << status.total_parts << ","
<< "\"assemblyLevel\": " << status.assembly_levels << ","
<< "\"connectionStatus\": \"" << status.connection_status << "\","
<< "\"openTime\": \"" << status.open_time << "\""
<< "},"
<< "\"error\": null"
<< "}";
} else {
json << "{"
<< "\"success\": false,"
<< "\"data\": null,"
<< "\"error\": \"No model is currently open\""
<< "}";
}
HttpResponse response;
response.body = json.str();
return response;
}
// 简单的JSON解析函数
std::string ExtractJsonValue(const std::string& json, const std::string& key) {
// 查找键值对 "key": "value"
std::string key_pattern = "\"" + key + "\"";
size_t key_pos = json.find(key_pattern);
if (key_pos != std::string::npos) {
// 找到冒号
size_t colon_pos = json.find(":", key_pos);
if (colon_pos != std::string::npos) {
// 跳过空格找到值的开始
size_t value_start = colon_pos + 1;
while (value_start < json.length() && (json[value_start] == ' ' || json[value_start] == '\t' || json[value_start] == '\n' || json[value_start] == '\r')) {
value_start++;
}
// 检查是否是字符串值(以双引号开始)
if (value_start < json.length() && json[value_start] == '"') {
size_t value_end = json.find('"', value_start + 1);
if (value_end != std::string::npos) {
return json.substr(value_start + 1, value_end - value_start - 1);
}
}
}
}
return "";
}
bool ExtractJsonBool(const std::string& json, const std::string& key) {
std::regex pattern("\"" + key + "\"\s*:\s*(true|false)");
std::smatch match;
if (std::regex_search(json, match, pattern)) {
return match[1].str() == "true";
}
return false;
}
// 模型导出路由处理器
HttpResponse ExportModelHandler(const HttpRequest& request) {
if (request.method != "POST") {
HttpResponse response;
response.status_code = 405;
response.body = "{\"success\": false, \"error\": \"Method not allowed\"}";
return response;
}
// 解析JSON请求体
std::string software_type = ExtractJsonValue(request.body, "software_type");
std::string format_type = ExtractJsonValue(request.body, "format_type");
std::string export_path = ExtractJsonValue(request.body, "export_path");
// 提取options中的geom_flags - 简化处理,避免正则表达式崩溃
std::string geom_flags = "solids"; // 默认值
// 简单的字符串查找方式,避免正则表达式
size_t options_pos = request.body.find("\"options\"");
if (options_pos != std::string::npos) {
size_t start_brace = request.body.find("{", options_pos);
if (start_brace != std::string::npos) {
size_t end_brace = request.body.find("}", start_brace);
if (end_brace != std::string::npos) {
std::string options_content = request.body.substr(start_brace + 1, end_brace - start_brace - 1);
std::string extracted_geom_flags = ExtractJsonValue(options_content, "geom_flags");
if (!extracted_geom_flags.empty()) {
geom_flags = extracted_geom_flags;
}
}
}
}
// 验证参数
if (software_type != "creo" || format_type != "step" || export_path.empty()) {
HttpResponse response;
response.status_code = 400;
response.body = "{\"success\": false, \"error\": \"Invalid parameters\"}";
return response;
}
// 执行导出
ExportResult result = CreoManager::Instance().ExportModelToSTEP(export_path, geom_flags);
HttpResponse response;
if (result.success) {
std::ostringstream json;
json << "{"
<< "\"success\": true,"
<< "\"data\": {"
<< "\"exportPath\": \"" << result.export_path << "\","
<< "\"fileSize\": \"" << result.file_size << "\","
<< "\"format\": \"" << result.format << "\","
<< "\"exportTime\": \"" << result.export_time << "\","
<< "\"software\": \"" << result.software << "\","
<< "\"originalFile\": \"" << result.original_file << "\","
<< "\"details\": {"
<< "\"dirname\": \"" << result.dirname << "\","
<< "\"filename\": \"" << result.filename << "\","
<< "\"creoson_response\": {"
<< "\"dirname\": \"" << result.dirname << "\","
<< "\"filename\": \"" << result.filename << "\","
<< "\"full_path\": \"" << result.export_path << "\""
<< "}}"
<< "},"
<< "\"error\": null"
<< "}";
response.body = json.str();
} else {
std::ostringstream json;
json << "{"
<< "\"success\": false,"
<< "\"data\": null,"
<< "\"error\": \"" << result.error_message << "\""
<< "}";
response.body = json.str();
response.status_code = 500;
}
return response;
}
extern "C" int user_initialize(
int argc,
char* argv[],
char* version,
char* build,
wchar_t errbuf[80])
{
pfcSession_ptr Session = pfcGetCurrentSessionWithCompatibility(pfcC4Compatible);
wfcWSession_ptr wSession = wfcWSession::cast(Session);
xstring info = L"New HTTP Server Starting on port 12345";
wSession->UIShowMessageDialog(info, NULL);
// 启动定时器处理消息
timer_id = SetTimer(NULL, 0, 100, TimerProc);
// 创建并启动HTTP服务器
g_http_server = std::make_unique<HttpServer>();
// 设置路由
g_http_server->SetRouteHandler("/test", TestHandler);
g_http_server->SetRouteHandler("/show_message", ShowMessageHandler);
g_http_server->SetRouteHandler("/api/status/creo", CreoStatusHandler);
g_http_server->SetRouteHandler("/api/status/model", ModelStatusHandler);
g_http_server->SetRouteHandler("/api/export/model", ExportModelHandler);
if (g_http_server->Start()) {
return 0;
} else {
g_http_server.reset();
return 1;
}
}
// --- OTK 出口函数 ---
// 这个函数在卸载插件或关闭 Creo 时被调用,非常重要!
extern "C" void user_terminate()
{
if (g_http_server) {
g_http_server->Stop();
g_http_server.reset();
}
if (timer_id != 0) {
KillTimer(NULL, timer_id);
timer_id = 0;
}
}

6
MFCCreoDll.def Normal file
View File

@ -0,0 +1,6 @@
; MFCCreoDll.def: DLL
LIBRARY
EXPORTS
;

27
MFCCreoDll.h Normal file
View File

@ -0,0 +1,27 @@
// MFCCreoDll.h: MFCCreoDll DLL 的主标头文件
//
#pragma once
#ifndef __AFXWIN_H__
#error "在包含此文件之前包含 'pch.h' 以生成 PCH"
#endif
#include "resource.h" // 主符号
// CMFCCreoDllApp
// 有关此类实现的信息,请参阅 MFCCreoDll.cpp
//
class CMFCCreoDllApp : public CWinApp
{
public:
CMFCCreoDllApp();
// 重写
public:
virtual BOOL InitInstance();
DECLARE_MESSAGE_MAP()
};

BIN
MFCCreoDll.rc Normal file

Binary file not shown.

31
MFCCreoDll.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35303.130
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MFCCreoDll", "MFCCreoDll.vcxproj", "{7DAAD03E-2254-46D7-9554-ECEE69E76DCA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7DAAD03E-2254-46D7-9554-ECEE69E76DCA}.Debug|x64.ActiveCfg = Debug|x64
{7DAAD03E-2254-46D7-9554-ECEE69E76DCA}.Debug|x64.Build.0 = Debug|x64
{7DAAD03E-2254-46D7-9554-ECEE69E76DCA}.Debug|x86.ActiveCfg = Debug|Win32
{7DAAD03E-2254-46D7-9554-ECEE69E76DCA}.Debug|x86.Build.0 = Debug|Win32
{7DAAD03E-2254-46D7-9554-ECEE69E76DCA}.Release|x64.ActiveCfg = Release|x64
{7DAAD03E-2254-46D7-9554-ECEE69E76DCA}.Release|x64.Build.0 = Release|x64
{7DAAD03E-2254-46D7-9554-ECEE69E76DCA}.Release|x86.ActiveCfg = Release|Win32
{7DAAD03E-2254-46D7-9554-ECEE69E76DCA}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BA9E3D0E-615B-4C19-A67E-98D7B8BD303D}
EndGlobalSection
EndGlobal

254
MFCCreoDll.vcxproj Normal file
View File

@ -0,0 +1,254 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectGuid>{7DAAD03E-2254-46D7-9554-ECEE69E76DCA}</ProjectGuid>
<Keyword>MFCDLLProj</Keyword>
<RootNamespace>MFCCreoDll</RootNamespace>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<UseOfMfc>Dynamic</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>C:\Program Files\PTC\Creo 5.0.0.0\Common Files\protoolkit\protk_appls\includes;C:\Program Files\PTC\Creo 5.0.0.0\Common Files\protoolkit\includes;C:\Program Files\PTC\Creo 5.0.0.0\Common Files\otk\otk_cpp\otk_examples\includes;C:\Program Files\PTC\Creo 5.0.0.0\Common Files\otk\otk_cpp\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\Program Files\PTC\Creo 5.0.0.0\Common Files\protoolkit\x86e_win64\obj;C:\Program Files\PTC\Creo 5.0.0.0\Common Files\otk\otk_cpp\x86e_win64\obj;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_WINDOWS;_USRDLL;USE_ANSI_IOSTREAMS;PRO_USE_VAR_ARGS;PRO_MACHINE=36;HYCOMMONWINAPI_EXPORTS;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<ModuleDefinitionFile>.\MFCCreoDll.def</ModuleDefinitionFile>
<AdditionalDependencies>protk_dllmd_NU.lib
;otk_cpp_md.lib
;otk_222_md.lib;
ucore.lib;
udata.lib;
kernel32.lib;
user32.lib
;wsock32.lib
;advapi32.lib
;mpr.lib
;winspool.lib
;netapi32.lib
;psapi.lib;
gdi32.lib
;shell32.lib;
comdlg32.lib
;ole32.lib;
ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>/FORCE:MULTIPLE /ignore:4049,4219,4217,4286
%(AdditionalOptions)</AdditionalOptions>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</Midl>
<ResourceCompile>
<Culture>0x0804</Culture>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<ModuleDefinitionFile>.\MFCCreoDll.def</ModuleDefinitionFile>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</Midl>
<ResourceCompile>
<Culture>0x0804</Culture>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>.\MFCCreoDll.def</ModuleDefinitionFile>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</Midl>
<ResourceCompile>
<Culture>0x0804</Culture>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_WINDOWS;NDEBUG;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<ModuleDefinitionFile>.\MFCCreoDll.def</ModuleDefinitionFile>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</Midl>
<ResourceCompile>
<Culture>0x0804</Culture>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="AuthManager.cpp" />
<ClCompile Include="CreoManager.cpp" />
<ClCompile Include="HttpRouter.cpp" />
<ClCompile Include="HttpServer.cpp" />
<ClCompile Include="JsonHelper.cpp" />
<ClCompile Include="Logger.cpp" />
<ClCompile Include="MFCCreoDll.cpp" />
<ClCompile Include="ModelAnalyzer.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ServerManager.cpp" />
<ClCompile Include="WebSocketServer.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="MFCCreoDll.def" />
<None Include="res\MFCCreoDll.rc2" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="AuthManager.h" />
<ClInclude Include="Config.h" />
<ClInclude Include="CreoManager.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="httplib.h" />
<ClInclude Include="HttpRouter.h" />
<ClInclude Include="HttpServer.h" />
<ClInclude Include="JsonHelper.h" />
<ClInclude Include="Logger.h" />
<ClInclude Include="MFCCreoDll.h" />
<ClInclude Include="ModelAnalyzer.h" />
<ClInclude Include="pch.h" />
<ClInclude Include="Resource.h" />
<ClInclude Include="ServerManager.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="WebSocketServer.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="MFCCreoDll.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

136
MFCCreoDll.vcxproj.filters Normal file
View File

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="源文件">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="资源文件">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="源文件\src">
<UniqueIdentifier>{761da677-5d81-41dd-89a3-4633b68a3f51}</UniqueIdentifier>
</Filter>
<Filter Include="源文件\src\core">
<UniqueIdentifier>{8fd55369-70b2-40ec-b5b1-de98ac94474c}</UniqueIdentifier>
</Filter>
<Filter Include="源文件\src\http">
<UniqueIdentifier>{44545dfa-015e-4a96-8606-2c8300f12584}</UniqueIdentifier>
</Filter>
<Filter Include="源文件\src\websocket">
<UniqueIdentifier>{c49458d6-8af1-4d4b-a0f6-b1bd38624f61}</UniqueIdentifier>
</Filter>
<Filter Include="源文件\src\creo">
<UniqueIdentifier>{54f41b77-5391-47a5-bb0e-e066a43eb9d1}</UniqueIdentifier>
</Filter>
<Filter Include="源文件\src\utils">
<UniqueIdentifier>{1fe71b11-38e5-49f6-8f30-c63793ff05fc}</UniqueIdentifier>
</Filter>
<Filter Include="源文件\src\auth">
<UniqueIdentifier>{a2c62494-7ba1-4dec-97ed-b38aba84f3a6}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="MFCCreoDll.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="pch.cpp">
<Filter>源文件</Filter>
</ClCompile>
<ClCompile Include="ServerManager.cpp">
<Filter>源文件\src\core</Filter>
</ClCompile>
<ClCompile Include="HttpServer.cpp">
<Filter>源文件\src\http</Filter>
</ClCompile>
<ClCompile Include="HttpRouter.cpp">
<Filter>源文件\src\http</Filter>
</ClCompile>
<ClCompile Include="WebSocketServer.cpp">
<Filter>源文件\src\websocket</Filter>
</ClCompile>
<ClCompile Include="CreoManager.cpp">
<Filter>源文件\src\creo</Filter>
</ClCompile>
<ClCompile Include="ModelAnalyzer.cpp">
<Filter>源文件\src\creo</Filter>
</ClCompile>
<ClCompile Include="JsonHelper.cpp">
<Filter>源文件\src\utils</Filter>
</ClCompile>
<ClCompile Include="Logger.cpp">
<Filter>源文件\src\utils</Filter>
</ClCompile>
<ClCompile Include="AuthManager.cpp">
<Filter>源文件\src\auth</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="MFCCreoDll.def">
<Filter>源文件</Filter>
</None>
<None Include="res\MFCCreoDll.rc2">
<Filter>资源文件</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClInclude Include="framework.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="Resource.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="MFCCreoDll.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="pch.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="httplib.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="ServerManager.h">
<Filter>源文件\src\core</Filter>
</ClInclude>
<ClInclude Include="Config.h">
<Filter>源文件\src\core</Filter>
</ClInclude>
<ClInclude Include="HttpServer.h">
<Filter>源文件\src\http</Filter>
</ClInclude>
<ClInclude Include="HttpRouter.h">
<Filter>源文件\src\http</Filter>
</ClInclude>
<ClInclude Include="WebSocketServer.h">
<Filter>源文件\src\websocket</Filter>
</ClInclude>
<ClInclude Include="CreoManager.h">
<Filter>源文件\src\creo</Filter>
</ClInclude>
<ClInclude Include="ModelAnalyzer.h">
<Filter>源文件\src\creo</Filter>
</ClInclude>
<ClInclude Include="JsonHelper.h">
<Filter>源文件\src\utils</Filter>
</ClInclude>
<ClInclude Include="Logger.h">
<Filter>源文件\src\utils</Filter>
</ClInclude>
<ClInclude Include="AuthManager.h">
<Filter>源文件\src\auth</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="MFCCreoDll.rc">
<Filter>资源文件</Filter>
</ResourceCompile>
</ItemGroup>
</Project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\Users\sladr\source\repos\MFCCreoDll\x64\Debug\MFCCreoDll.dll</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,11 @@
C:\Users\sladr\source\repos\MFCCreoDll\AuthManager.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\AuthManager.obj
C:\Users\sladr\source\repos\MFCCreoDll\CreoManager.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\CreoManager.obj
C:\Users\sladr\source\repos\MFCCreoDll\HttpRouter.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\HttpRouter.obj
C:\Users\sladr\source\repos\MFCCreoDll\HttpServer.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\HttpServer.obj
C:\Users\sladr\source\repos\MFCCreoDll\JsonHelper.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\JsonHelper.obj
C:\Users\sladr\source\repos\MFCCreoDll\Logger.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\Logger.obj
C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\MFCCreoDll.obj
C:\Users\sladr\source\repos\MFCCreoDll\ModelAnalyzer.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\ModelAnalyzer.obj
C:\Users\sladr\source\repos\MFCCreoDll\pch.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\pch.obj
C:\Users\sladr\source\repos\MFCCreoDll\ServerManager.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\ServerManager.obj
C:\Users\sladr\source\repos\MFCCreoDll\WebSocketServer.cpp;C:\Users\sladr\source\repos\MFCCreoDll\MFCCreoDll\x64\Debug\WebSocketServer.obj

View File

@ -0,0 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.41.34120:TargetPlatformVersion=10.0.16299.0:
Debug|x64|C:\Users\sladr\source\repos\MFCCreoDll\|

Binary file not shown.

View File

@ -0,0 +1,3 @@
^C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\AUTHMANAGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\CREOMANAGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\HTTPROUTER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\HTTPSERVER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\JSONHELPER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\LOGGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\MFCCREODLL.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\MFCCREODLL.RES|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\MODELANALYZER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\PCH.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\SERVERMANAGER.OBJ|C:\USERS\SLADR\SOURCE\REPOS\MFCCREODLL\MFCCREODLL\X64\DEBUG\WEBSOCKETSERVER.OBJ
C:\Users\sladr\source\repos\MFCCreoDll\x64\Debug\MFCCreoDll.lib
C:\Users\sladr\source\repos\MFCCreoDll\x64\Debug\MFCCreoDll.EXP

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

0
ModelAnalyzer.cpp Normal file
View File

1
ModelAnalyzer.h Normal file
View File

@ -0,0 +1 @@
#pragma once

16
Resource.h Normal file
View File

@ -0,0 +1,16 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// 供 MFCCreoDll.rc 使用
//
// 新对象的下一组默认值
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 1000
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 1000
#define _APS_NEXT_COMMAND_VALUE 32771
#endif
#endif

0
ServerManager.cpp Normal file
View File

1
ServerManager.h Normal file
View File

@ -0,0 +1 @@
#pragma once

0
WebSocketServer.cpp Normal file
View File

1
WebSocketServer.h Normal file
View File

@ -0,0 +1 @@
#pragma once

35
framework.h Normal file
View File

@ -0,0 +1,35 @@
#pragma once
#ifndef VC_EXTRALEAN
#define VC_EXTRALEAN // 从 Windows 头中排除极少使用的资料
#endif
#include "targetver.h"
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 构造函数将是显式的
#include <afxwin.h> // MFC 核心组件和标准组件
#include <afxext.h> // MFC 扩展
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h> // MFC OLE 类
#include <afxodlgs.h> // MFC OLE 对话框类
#include <afxdisp.h> // MFC 自动化类
#endif // _AFX_NO_OLE_SUPPORT
#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h> // MFC ODBC 数据库类
#endif // _AFX_NO_DB_SUPPORT
#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h> // MFC DAO 数据库类
#endif // _AFX_NO_DAO_SUPPORT
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxdtctl.h> // MFC 对 Internet Explorer 4 公共控件的支持
#endif
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC 对 Windows 公共控件的支持
#endif // _AFX_NO_AFXCMN_SUPPORT

8552
httplib.h Normal file

File diff suppressed because it is too large Load Diff

5
pch.cpp Normal file
View File

@ -0,0 +1,5 @@
// pch.cpp: 与预编译标头对应的源文件
#include "pch.h"
// 当使用预编译的头时,需要使用此源文件,编译才能成功。

13
pch.h Normal file
View File

@ -0,0 +1,13 @@
// pch.h: 这是预编译标头文件。
// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
#ifndef PCH_H
#define PCH_H
// 添加要在此处预编译的标头
#include "framework.h"
#endif //PCH_H

BIN
res/MFCCreoDll.rc2 Normal file

Binary file not shown.

8
targetver.h Normal file
View File

@ -0,0 +1,8 @@
#pragma once
// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
//如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h
// 将 _WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
#include <SDKDDKVer.h>

BIN
x64/Debug/MFCCreoDll.dll Normal file

Binary file not shown.

BIN
x64/Debug/MFCCreoDll.exp Normal file

Binary file not shown.

BIN
x64/Debug/MFCCreoDll.lib Normal file

Binary file not shown.

BIN
x64/Debug/MFCCreoDll.pdb Normal file

Binary file not shown.