Reuse define statement from .h file in C# code

前端 未结 7 1895
广开言路
广开言路 2021-01-18 14:08

I have C++ project (VS2005) which includes header file with version number in #define directive. Now I need to include exactly the same number in twin C# project. What is th

7条回答
  •  星月不相逢
    2021-01-18 14:38

    You can write simple C++/C utility that include this .h file and dynamically create file that can be used in C#.
    This utility can be run as a part of C# project as a pre-build stage.
    This way you are always sync with the original file.

提交回复
热议问题