Displaying a bmp file that is being changed

Hello everyone!!

I hit a wall once again!. I have an application that performs some calculation and creates as a result a bmp file, then displays this result as a pop-up window (in a dialog box) that appears after pressing a button located in the main window.

Then, if I changed the parameters for the calculation the application creates a new bmp file; but If I press the button again the resultant image is always the first one to be loaded, i.e. the display does not updates itself even though the file has changed.

I did the implementation of the displaying of the image inside the WM_ERASEBKGND case of the dialog box procedure, using the LoadBitmap function. I do the cleaning and freeing of the Device context properly.

The question is, why is this happening? How can I make the reading and displaying of the image responding in real time to the changes in the bmp file?

Thanks a lot.
LoadBitmap loads the bitmap from the executable itself, which cannot be changed at runtime.
You need LoadImage function.
Thanks modoran.

It worked perfectly. I guess I will have to study the differences between using the two functions to load a bmp; but the important thing is that it works.

I guess I will have to study the differences between using the two functions to load a bmp;


Not really. LoadBitmap is deprecated. You should always use LoadImage.

There's nothing you can do with LoadBitmap that can't be done with LoadImage.
Topic archived. No new replies allowed.