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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:50:37+00:00 2026-05-28T06:50:37+00:00

My immediate context is the Windows platform, however I might also ask this same

  • 0

My immediate context is the Windows platform, however I might also ask this same question when working on a ui for another gui host. I’m working in fairly plain c++ winapi, without ATL/MFC. I’m not interested in using globals, but rather a more oop accepted practice of performing “Window” related tasks with “Application” data.

I’ve considered implementing mvvw or mvc style patterns to this, but before I go ahead I’d like some community opinions, from what I imagine are countless experienced developers and designers.

My Application class has Window members. Should the Window class be designed with an Application reference? Or is there a better way than this?

  • 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-28T06:50:38+00:00Added an answer on May 28, 2026 at 6:50 am

    The Win API of a Window gives you a Set/GetProperty() which allows you to define a pointer to whatever you’d like (i.e. your own window object.) However, from experience I know that’s rather slow.

    The other possibility is to use a map where the pointer of the Win API windows are used as keys and the value is your window object. This is a lot faster, but where do you put that map if you don’t have any globals?

    As suggested by Samuel, a singleton allows you to get an object which is pretty much the same as a global. Then you can get your window object using the Win API window pointer as the key and it returns your object.

    This is required to map incoming events to your window objects. Everything else should anyway be done the other way around (As you’d expect, call functions only on your window object that are mapped in a similar way as the system windows.)

    Why aren’t you using Qt? it’s already in C++ and you don’t have to worry about those details…

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

Sidebar

Related Questions

When I type this into the Visual Studio 2008 immediate window: ? .9 -
To start with some context, I'm so annoyed whenever I get on a Windows
I'm using Jquery colorbox to implement a popup windows. This pop-up is immediately open
The Immediate Window is an immensely useful tool for debugging applications. It can be
From the Immediate Window in Visual Studio: > Path.Combine(@C:\x, y) C:\\x\\y > Path.Combine(@C:\x, @\y)
It would seem the Immediate window needs some jazzing up ala IntelliSense? Anyone agree/disagree?
how can i get immediate parent of a given element ? $(e.target).parent() ?
Once I've created a variable in the immediate window in C# (VS2008), is there
Of course, the immediate answer for most situations is yes , and I am
I seem to recall something about avoiding the Immediate If operator ( ?: )

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.