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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:54:02+00:00 2026-05-23T14:54:02+00:00

I was browsing through the sources of a (prefer not to name) GUI Toolkit

  • 0

I was browsing through the sources of a (prefer not to name) GUI Toolkit which wrapped up the Windows API when I found the following function definition in the window class:

 virtual LRESULT CALLBACK wndProc (HWND, UINT, WPARAM, LPARAM) = 0;

What is happening here? How can you assign a function to an integer? Or does it assign it to NULL? Do you need to do this if you want to use function pointers in the wndproc?

  • 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-23T14:54:02+00:00Added an answer on May 23, 2026 at 2:54 pm

    That line of code defines a pure virtual function in C++. It has nothing to do with the otherwise tricky Win32 API or GUI code in general.

    A pure virtual function is a virtual function that is used when the designer of the class wants to force derived classes to override the function and provide their own implementation.

    If a class contains any pure virtual functions, it is considered an “abstract” class and instances of that class cannot be instantiated.

    C++ uses the special syntax = 0; to indicate pure virtual functions instead of adding a new keyword to the language (as languages like C# do). You can think of it as setting the function pointer to 0.

    Also see the answers to this related question: What are the uses of pure virtual functions in C++?

    (By the way, the Windows header files <windows.h> simply define NULL as 0. So the programmer technically could have written = NULL, but it’s much clearer to use the numeric constant 0 and reserve NULL for pointer values.)

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

Sidebar

Related Questions

Browsing through the channel 9 msdn videos I found the following unanswered comment and
I was browsing through a webpage which had some c FAQ's, I found this
Browsing through the source of 1.7rc1, line 6625, I've found the .swap function: //
I was browsing through Windows's Platform SDK header files (what a life, right?), and
Question says it all. I tried browsing through the latest tag but could not
I'm browsing through OpenJDK sources and cannot find the place where optimized code is
Browsing through the source code of Microsoft's sample StockTrader application, I found this snippet
I was just browsing through the draft of the C++11 standard and found the
I was just browsing through gcc source files. In gcc.c , I found something
I'm browsing through the Zepto source code and there is this little function here:

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.