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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:29:45+00:00 2026-05-27T10:29:45+00:00

I am attempting to make a custom GLWindow class that includes all of my

  • 0

I am attempting to make a custom GLWindow class that includes all of my setting up of my OpenGL window. However, I also want to include the WndProc callback function for messages being sent to the window in my GLWindow class.

GLWindow.h:

class GLWindow
{
    private:
        HWND hWnd;
        HDC hDC;
        HGLRC hRC;
    public:
        GLWindow();

        LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

        bool Create();

        ~GLWindow();
}

GLWindow.cpp:

GLWindow::GLWindow()
{

}

bool GLWindow::Create(int width, int height, char * title, bool fullscreen)
{
    WNDCLASSEX window;

    HINSTANCE hInstance;

    hInstance = GetModuleHandle(NULL);
    window.cbSize = sizeof(WNDCLASSEX);
    window.cbClsExtra = 0;
    window.cbWndExtra = 0;
    window.hbrBackground = NULL;
    window.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    window.hIconSm = LoadIcon(NULL, IDI_WINLOGO);
    window.hCursor = LoadCursor(NULL, IDC_ARROW);
    window.hInstance = hInstance;
    window.lpfnWndProc = GLWindow::WndProc; // ERROR
}

GLWindow::~GLWindow()
{

}

The Error is that a value of type “LRESULT (__stdcall GLWindow::*)(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)” cannot be assigned to an entity of type “WNDPROC.”

I can’t figure it out

I’ve gotten this to work when WndProc shares the same .cpp file as the WinMain function, but it seems as if the scope throws it off.

  • 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-27T10:29:46+00:00Added an answer on May 27, 2026 at 10:29 am

    It should be a static or global function. Class member function expects to receive an additional hidden parameter called this, so the signature doesn’t match.

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

Sidebar

Related Questions

I'm attempting to make a custom ContentProvider so that more than one application (activity?)
I am attempting make a simulator class that will use a Queue to add
You can see my project here - http://www.inluxphoto.com/custom/jsgallery/index.php I am attempting to make the
Attempting to make a NSObject called 'Person' that will hold the login details for
I'm attempting to make a simple linear text game that will display inside a
I'm attempting to make a drop shadow for a custom NSView subclass. So far,
I'm attempting to write a custom MarkupExtension to make my life easier by giving
Im attempting to make a little app that lets you add text boxes to
I'm attempting to make a generic routine within my program that will instantiate objects
I am attempting to make it so that whenever a checkbox is checked 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.