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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:47:19+00:00 2026-06-12T22:47:19+00:00

I am working on a MFC project with Kinect that uses a FPS counter.

  • 0

I am working on a MFC project with Kinect that uses a FPS counter. This is a static text. I want this FPS counter to be editted by a method which is also responsible for make the kinect images. So in my main I pass the HWND on to my kinect object like this:

kinect->initialize(this->GetSafeHwnd());

In my kinect object this thing gets saved:

this->hwnd = hWnd;

and then this piece of code to initialize the Static Text I want to use:

CStatic * MFC_ecFPSCOLOR;
MFC_ecFPSCOLOR = (CStatic *) GetDlgItem(hWnd, TC_FPSCOLOR);

And then I want to use it:

MFC_ecFPSCOLOR->SetWindowTextW(L"TEST");

And here it goes wrong:

Unhandled exception at 0x54431C19 (mfc110ud.dll) in KinectMain.exe: 0xC0000005: Access violation reading location 0x0031004C.

Can someone point me in the right direction?

  • 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-12T22:47:20+00:00Added an answer on June 12, 2026 at 10:47 pm

    You’re using the wrong version of GetDlgItem, it returns a handle and not a CWnd*. The cast is hiding the error from you.

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

Sidebar

Related Questions

So I'm working on a class project that uses MFC. I never had to
Currently I am working in a project that uses MFC a lot, but it
I'm currently working on an upgrade to a project that extensively uses COM /
I'm working on a win32/MFC project. I have a custom CListCtrl control that I
I'm working on a project that is using the Qt/MFC Migration Framework and I'm
I'm working on an MFC application, that got pretty messy over years and over
I am working with a legacy MFC (VC 6) application that needs to be
I'm working on a bug where I have an MFC application that does weird
I am working on MFC with c++. i got this error: Cannot open include
I am working on an old MFC project. Users are using Windows 7 they

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.