Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 42641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:22:12+00:00 2026-05-10T15:22:12+00:00

I have C++ project (VS2005) which includes header file with version number in #define

  • 0

I have C++ project (VS2005) which includes header file with version number in #define directive. Now I need to include exactly the same number in twin C# project. What is the best way to do it?

I’m thinking about including this file as a resource, then parse it at a runtime with regex to recover version number, but maybe there’s a better way, what do you think?

I cannot move version outside .h file, also build system depends on it and the C# project is one which should be adapted.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T15:22:12+00:00Added an answer on May 10, 2026 at 3:22 pm

    You can achieve what you want in just a few steps:

    1. Create a MSBuild Task – http://msdn.microsoft.com/en-us/library/t9883dzc.aspx
    2. Update the project file to include a call to the task created prior to build

    The task receives a parameter with the location of the header .h file you referred. It then extracts the version and put that version in a C# placeholder file you previously have created. Or you can think using AssemblyInfo.cs that normally holds versions if that is ok for you.

    If you need extra information please feel free to comment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 61k
  • Answers 61k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Sounds like you're using X, so what you probably want… May 11, 2026 at 9:40 am
  • added an answer You are telling it that you want to connect to… May 11, 2026 at 9:40 am
  • added an answer 8 * sizeof(b) is the number of bits that can… May 11, 2026 at 9:40 am

Related Questions

I have C++ project (VS2005) which includes header file with version number in #define
I have this large C++ project that I need to build on a platform
I have an existing C++ project on a linux environment, and would like to
I have a Qt/C++ project and an old VB6 project. The user base might
I have a large exiting C++ project involving: 4 applications 50+ libraries 20+ third
I have a large legacy C++ project compiled under Visual Studio 2008. I know
I have recently started working on a very large C++ project that, after completing
In a C++ project I'm working on, I have a flag kind of value
I have been banging my head on this one all day. The C++ project
I have a project in a c++ solution. For that project, I have some

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.