Mr.Tickle said:
I have a .H file with tonnes of #define constants and I want to
access that from C# but I dont want to rewrite the header file as a
class.
Is there a way after including that in MC++ to get those values from
C#?
There are several issues. If you use managed C++ to get the manifest
constants into an assembly you are relying on the C preprocessor to paste
values into your code, for example if you have:
#define SIZE 45
then whenever your code uses SIZE the C preprocessor will insert the value
of 45 before the code is compiled. The constant is not available to any
other code unless you write that code in managed C++ and include the header.
So those constants will not be available to your C# code.
Also, the technique is not object orientated. It is better to copy the
constants into your C# class as a const field, that way the constant is
associated with the code that will use it.
Richard