Welcome to Dream.In.Code
Become a C# Expert!

Join 150,413 C# Programmers for FREE! Get instant access to thousands of C# experts, tutorials, code snippets, and more! There are 1,013 people online right now. Registration is fast and FREE... Join Now!




Sharing constants between C++ and C#

 
Reply to this topicStart new topic

Sharing constants between C++ and C#, Not #define, not const...

killnine
14 Mar, 2008 - 08:54 AM
Post #1

D.I.C Head
**

Joined: 12 Feb, 2007
Posts: 114



Thanked: 5 times
My Contributions
A co-worker and myself are working on a joint project. His backend is in C++ because he needs to interface with some hardware that only has a C++ interface. He has programmed a wrapper (.dll) for me to call methods from via a C# front-end. However, we are looking to be able share constants between the two.

He suggested having a list of #define but there isn't any #define that is usable in C# other than for #if directives.

I guess we could both use CONST but I am wondering how we could use a single file as a reference so we only have to modify values in a single file.

As he stated, if we just could reference a .h file, we could put a bunch of common constants and it call it a day. Unfortunately, this isn't possible between C++ and C# as I see it.

Any thoughts or suggestions on solving this issue?
User is offlineProfile CardPM
+Quote Post

bhandari
RE: Sharing Constants Between C++ And C#
15 Mar, 2008 - 10:15 AM
Post #2

D.I.C Addict
Group Icon

Joined: 31 Jan, 2008
Posts: 747


Dream Kudos: 900
My Contributions
you can go for properties/xml file to store your data constants!!!
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 08:00PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C# Help!

C# Tutorials

Reference Sheets

C# Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month