/ Published in: C#
If you are using c++/cli or UnmanagedExports, this is a useful way to share enum int values between c++ and c# code/DLLs without worrying about duplicated code going out of date.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
CS: ------------------- #if !cpp using System; namespace MyProject { class ECommandEnum { public //enum CommandEnum #endif enum CommandEnum { Move = 0, Wait }; #if !cpp } } #endif CPP: ------------------- #include "whatever.h" #define cpp (1) #include "F:\dev\MyProject\CommandEnum.cs" int main() { }
URL: cs_cpp_shared_enum