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 7618743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:29:02+00:00 2026-05-31T03:29:02+00:00

If one includes windows.h in a c++ file in Visual Studio, they then have

  • 0

If one includes windows.h in a c++ file in Visual Studio, they then have a global identifier named STANDARD_RIGHTS_ALL defined. I would like to use that name as a name for a static member variable in a class I am creating. I attempted to do it as follows…

class ACLAmigo
{
public:
    static int STANDARD_RIGHTS_ALL;
    ACLAmigo(void);
    ~ACLAmigo(void);
};

Later on in another file I have this…

int ACLAmigo::STANDARD_RIGHTS_ALL = 1;

But the IDE complains thusly: “Error: expected an identifier”.

Question: Can I use this already declared identifier STANDARD_RIGHTS_ALL as a member variable name and if so how?

  • 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-05-31T03:29:03+00:00Added an answer on May 31, 2026 at 3:29 am

    The problem is that STANDARD_RIGHTS_ALL (and most of the other things) is the macro. Macros are always “globally defined”. Moreover, they’re resolved by the preprocessor before the compiler starts to analyze your code so that your code turns into:

    static int 0x001F0000 /*STANDARD_RIGHTS_ALL*/;
    

    which is a nonsense.

    Either pick another variable name, or undefine that macro:

    #undef STANDARD_RIGHTS_ALL
    static int STANDARD_RIGHTS_ALL; // now it's ok
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In php we use includes. So variables defined in one file and then their
i have one solution file in visual studio, and i have in it two
Suppose I have a C++ project in Visual Studio 2010 in Windows 7 with
I am trying to learn Windows.Forms, and while I have Visual Studio (edit, my
I have a Windows service written in C# using Visual Studio 2010 and targeting
I wanted to create one js file which includes every js files to attach
I have Visual Studio 2010 Professional as well as Expression Blend 4 loaded on
In visual studio i want to add a second code behind file to a
I'm new to Visual Studio and Windows as a development platform, and I'm having
Quick background. I'm using the following: Windows XP Visual Studio 6.0 When you specify

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.