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

  • SEARCH
  • Home
  • 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 8021907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:07:15+00:00 2026-06-04T22:07:15+00:00

First, yes, I have seen these posts: Is there an easy way in C#

  • 0

First, yes, I have seen these posts:
Is there an easy way in C# to have conditional compilation symbols based on OS version
Conditional compilation depending on the framework version in C#
but they do not target the direction I am looking for.

What I am looking for specifically is variable _type_ qualification via OS version:

public struct REPASTESPECIAL
{
     UInt32   dwAspect;
#if WINVER >= 6.0
     UIntPtr  dwParam;
#else
     UInt32   dwParam;
#endif 
}

I do not wish to revert to something like this:

public struct REPASTESPECIAL<T>
{
     UInt32     dwAspect;
     T dwParam;
}
// return type by OS version
public static Type GetRePasteSpecial_ParamType()
{
    if (Environment.OSVersion.Version.Major >= 5) return typeof(IntPtr);
    else return typeof(UInt32);
}

…as that would permit programmers to use any object of Type T when I desire dwParam to be an IntPtr or an UInt32 object only, but if I must then so be it, and make this a reference for others looking for the same.

  • 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. Editorial Team
    Editorial Team
    2026-06-04T22:07:16+00:00Added an answer on June 4, 2026 at 10:07 pm

    No – conditional compilation works at compile time, whereas it looks like you’re after something which works at execution time.

    EDIT: Just thinking about it, you could use conditional compilation in one sense: you could encapsulate this as far as possible in its own assembly, and compile it two ways, producing two separate assemblies. Then at install time (or whatever) install the right assembly. It’s hard to know how feasible that is without knowing what kind of app you’re writing though.

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

Sidebar

Related Questions

I have an AXIS2/JAX-WS web service using a code first implementation (yes I know,
i have seen a few days ago such problem there is given two array
First, yes I have searched already and found this answer already: GWT JSNI -
I have a form which has First Name, Last Name text boxes, Radio button(Yes
Yes i have this line in my first upload case of the switch: $file_name
First of all, yes I have read the other articles deal (I like your
I have developed my first COM component (yes, a newbie in the realm of
I have a problem that I have not seen addressed in this particular way
First of all, yes, I know I'm a newbie, and this is my first
I wrote my first program almost fifty years ago (yes, coding is still a

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.