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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:55:42+00:00 2026-06-06T09:55:42+00:00

Debugging in Visual Studio 2010 (C++, unmanaged), what is the information unused ??? or

  • 0

Debugging in Visual Studio 2010 (C++, unmanaged), what is the information unused ??? or unused 0 supposed to mean? I have attached two screenshots, child is a HWND to an existing window.

I am also confused by the fact, that the HWND is sometimes displayed as “unused”, sometimes as “0”. When having a pointer referring to unallocated memory, I’d understand the situation, but in my particular case the window is already created and valid.

VS2010 unused=???

VS2010 unused=0

  • 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-06T09:55:43+00:00Added an answer on June 6, 2026 at 9:55 am

    This goes back to the early nineties, back when there was just a HANDLE as a type to declare a handle of any Windows object. Which was a bug factory, programmers could fumble code and, say, pass a font handle where a window handle was required. So the STRICT macro was added later, it redeclared handle types so mixing produces a compiler error. Which looks like this in winnt.h, edited for content:

    #ifdef STRICT
       typedef void *HANDLE;
       #define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name
    #else
       typedef PVOID HANDLE;
       #define DECLARE_HANDLE(name) typedef HANDLE name
    #endif
    

    Example usage:

    DECLARE_HANDLE(HWND);
    

    The struct macro soup ensures that a HFONT can never be used where a HWND is expected when STRICT is turned on, it produces a type mismatch on the structure type.

    You can now see where “unused” comes from. It is in fact unused, only Windows can create handle values. It is helpful in the debugger since it lets you look at the handle value, with 0 or -1 being a sure sign of trouble.

    More about STRICT in this MSDN article.

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

Sidebar

Related Questions

I know there have been some major improvements in Visual studio 2010 for debugging
I’m using Visual Studio 2010 to write unmanaged C++ code. When debugging, anything printed
When debugging a C++ Project using Visual Studio 2010, it cannot find the source
I have a problem debugging Invoke() or BeginInvoke() in Visual Studio 2008. For instance
While debugging my Visual Studio 2010 MVC2 solution, I noticed something that I didn't
I'm facing problems when i try to debugging with Visual Studio 2010. My breakpoints
In Visual Studio 2010 I have created a WebService (WCF) Application and a client
I'm debugging an application in Visual Studio 2010 going step by step and, astonishingly,
I have a visual studio 2010 web project that when I publish it in
I'm debugging my c++ code in Visual Studio 2010 and want to see the

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.