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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:22:57+00:00 2026-06-14T16:22:57+00:00

In order to prevent the WM_LBUTTONUP event from being flooded with code, I decided

  • 0

In order to prevent the WM_LBUTTONUP event from being flooded with code, I decided to make a class method that contains the code which initially triggered on WM_LBUTTONUP.

Example:

 case WM_LBUTTONUP:
 {//Code that used to trigger on WM_LBUTTONUP below:
  x=4;
  y=2;
  SendMessage(hWnd, CUSTOM_WMMESSAGE, NULL, NULL);
}//The above SendMessage() call works

Method Definition:

void Dog::bark(HWND hindow, INT wm_message)
{//All code that used to trigger on WM_LBUTTON up was moved to this method
 x=4;
 y=2;
 SendMessage(hwindow, wm_message, NULL, NULL);
}

Afterward:

case WM_LBUTTONUP:
{Object.bark();}
//When SendMessage was called this way (inside of a method definition)
//it did not work!

Problem:

SendMessage() worked on WM_LBUTTONUP when it was not used inside of a class method. However, once I called SendMessage() from a class method on WM_LBUTTONUP, the message was not sent (which means, SendMessage() did not, or does not work when called from a class method).

Please Note:

The method definition is not in the same file as WM_LBUTTON up (and I would like to keep it that way, to prevent main.cpp from being filled with too much code 🙂 )

Edit

The file name which contains the class’ definition is called Dog.hpp
I included Dog.hpp inside of main.cpp.
I have successfully created other class methods (inside of dog.hpp) which worked, so I know there’s nothing wrong with the class or the header file code. The only problem is, that when the SendMessage() function is called inside of dog.hpp, as apposed to being called in main.cpp, it does not work.

  • 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-14T16:22:58+00:00Added an answer on June 14, 2026 at 4:22 pm

    Object.bark() expects input parameters that you are not passing in to it. You need to do this instead:

    case WM_LBUTTONUP:
    {
        Object.bark(hWnd, CUSTOM_WMMESSAGE);
        break; // <-- this is missing in your original code as well!
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In order to prevent a SQLite in-memory database from being cleaned up, one must
It is said that in order to prevent from SQL injection one should filter
I have this part of code which i use in order to prevent query
In order to prevent somebody from grabbing my data easily, I cache data from
in order to recover data from server I use XMLHttpRequest and my code is
I have a table which stores 'links' between 2 people. In order prevent further
I have a bufferPool which stores a lot of objects. In order to prevent
I was wondering if they was a way to prevent some commands from being
I am working on a program that includes a selection of code which is
In order to prevent command windows from popping up during installation I am using

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.