How can I expose a constant defined in unmanaged code to managed code?
I have a C++ DLL which has a constant defined as such:
#define GPC_EPSILON (DBL_EPSILON)
Is there any way to expose this GPC_EPSI开发者_运维技巧LON
to the managed DLL via interop so that I can get this value from the .NET DLL?
No.
Constants in #define
's are replaced by the pre-processor before compilation. They are not exposed as variables.
精彩评论