Barbless
asked on
Software Engineer
Is it possible in C# to use the  structs defined in an unmanaged header file?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks gregoryyoung and josgood, I think I'll write the conversion util, as you both suggested.
One question though, how do I read the converted file in C#? Would it be something simple like using "using"?
One question though, how do I read the converted file in C#? Would it be something simple like using "using"?
Sounds like you want to write the conversion utility to take a C header and emit a C# .cs file.
I've assumed all along that you would include the .cs file in your project.
I've assumed all along that you would include the .cs file in your project.
well you could compile it into a .dll and use using ... or you could just include the .cs files in your compile (or add to your project if you build through VS.NET)
ASKER
What I'm trying to avoid is to have 2 sets of struct definitions, one for C# and the other for C. This way, I don' t have to worry about breaking the SW if one is changed but forgot to make corresponding change to the other.