CreoPluging9.0/CreoOtk.h
2026-01-15 16:23:23 +08:00

46 lines
1.5 KiB
C

#pragma once
#ifndef __cplusplus
#error "This project must be compiled as C++ (ensure cl.exe uses /TP and the file is compiled as C++)."
#endif
// Centralized include entry for Creo Object TOOLKIT C++ (OTK) headers.
// Also neutralizes SEH macro pollution (try/except/finally/leave) that can break C++ try/catch.
#include <pfcCommand.h>
#include <pfcExceptions.h>
#include <pfcGlobal.h>
#include <pfcModel.h>
#include <pfcSession.h>
#include <pfcShrinkwrap.h>
#include <pfcSolid.h>
#include <pfcUI.h>
// Some Creo/Windows headers may redefine these identifiers as SEH macros.
#ifdef try
#undef try
#endif
#ifdef except
#undef except
#endif
#ifdef finally
#undef finally
#endif
#ifdef leave
#undef leave
#endif
// Fail-fast if anything reintroduced SEH macro aliases after our cleanup.
#ifdef try
#error "Macro 'try' is defined (likely from Windows Kits warning.h). Ensure DONT_REDEFINE_TRYEXCEPT_IN_WARNING_H is set in project preprocessor definitions."
#endif
#ifdef except
#error "Macro 'except' is defined (likely from Windows Kits warning.h). Ensure DONT_REDEFINE_TRYEXCEPT_IN_WARNING_H is set in project preprocessor definitions."
#endif
#ifdef finally
#error "Macro 'finally' is defined (likely from Windows Kits warning.h). Ensure DONT_REDEFINE_TRYEXCEPT_IN_WARNING_H is set in project preprocessor definitions."
#endif
#ifdef leave
#error "Macro 'leave' is defined (likely from Windows Kits warning.h). Ensure DONT_REDEFINE_TRYEXCEPT_IN_WARNING_H is set in project preprocessor definitions."
#endif