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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:21:37+00:00 2026-06-16T00:21:37+00:00

I am trying to debug a very old C program in visual studio. I

  • 0

I am trying to debug a very old C program in visual studio. I was stepping through some code line by line and came to a line DispatchMessage(&msg); I wanted to see where the code went next, so I clicked the “Step into” button, but I was not taken to any new code that processed the message, instead the little yellow arrow just stepped along to the next line down the same page…

Is this expected behaviour? How can I see what DispatchMessage actually did?
Could this be an indication that the window handler is not set up correctly?

extra info: The task I was tring to debug was the processing of a mouse click on a particular window. I had displayed the msg structure, and msg.hwnd was the window I had clicked on (I used Winspector to confirm). The msg.message was 513 (=WM_LBUTTONDOWN).

  • 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-16T00:21:38+00:00Added an answer on June 16, 2026 at 12:21 am

    This is completely expected behaviour…

    DispatchMessage() is implemented in User32.dll and as such, the source code is not available. For the most part, you have to treat Win32 API calls as blackboxes. At times, this can really make debugging Win32 code a challenge.

    Remember, there are some tricks in your arsenal for debugging this kind of thing:

    1. Go on treating DispatchMessage() as a black box. Place a breakpoint on the WndProc you expect to receive the WM_LBUTTONDOWN and continue debugging there.

    2. Have Winspector log the messages coming into all of the windows involved. This can help make sure the message is received and in the order you are expecting.

    3. If worst comes to worst, you may have to step into DispatchMessage() or some other API call, looking at its disassembly. Most of the time, nothing good comes from that (but I always learn something when I do).

    Chances are that option #3 won’t be necessary and your time would be better spent debugging around DispatchMessage() rather than within it.

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

Sidebar

Related Questions

I have a very persistent problem, im trying to debug the program through the
I'm trying to debug an old VB6 program at my job. It's full of
I'm trying to debug some legacy Integration Services code, and really want some confirmation
I'm trying to debug some STL based C++ code in gdb. The code has
Hi I'm very novice to coldfusion and I am trying to debug some cfscript
I'm trying to write some very simple code to play an audio file. The
I am trying to debug a very nefarious problem with some iPhone Core Data
I'm trying to debug a C/C++ native DLL project from Visual Studio 2010. I'm
I'm still trying to debug a very sneaky memory corruption problem. I came across
Hey guys Im currently trying to debug some code for a mysqli encapsulation class.

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.