Refreshing images

This is a discussion on Refreshing images within the C++ Programming forums, part of the General Programming Boards category; Hi everyone, I have made a program which downlaods an image from a certain URL when it is run, and ...

  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    128

    Refreshing images

    Hi everyone,

    I have made a program which downlaods an image from a certain URL when it is run, and deposits it in My Documents. I have then made a dailog box to display it in. The image downloads OK, and it is desposited in the My Documents folder, but when I open the window to display it, the old version is displayed, despite the fact that I have downloaded and displayed the latest image from the URL.

    Here is the code, which is set to download the image and then display it:

    Code:
    				case IDC_SUN:
    					{
    					HRESULT hr = URLDownloadToFile ( NULL, _T("http://georgek.heliohost.org/Asteroid.bmp"), _T("c:/Documents and Settings/XP/My Documents/latest.bmp"), 0, NULL );
    					}
    					DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_SUNPAGE), hwnd, ToolDlgProc);
    				break;
    It just seems to pull the last image from its memory, even though the actual image in My Documents has changed. How do I refresh it to display the image after I have made changes?

    Thanks.

  2. #2
    Registered User
    Join Date
    Feb 2010
    Posts
    128
    It seems as though the program is just using one image and keeping that one in its memory, even if I change the actual file. How do I get the frame to import the new image on command? Is it the resource?

    Here are the resource files for the bitmap and the frame:

    Bitmap:

    Code:
    LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
    IDB_SUNPIC        BITMAP         "C:\\Documents and Settings\\XP\\My Documents\\latest.bmp"
    Frame:

    Code:
        CONTROL         IDB_SUNPIC, IDC_SUNFRAME, WC_STATIC, SS_BITMAP, 30, 12, 341, 236

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Images
    By _Nate_ in forum C Programming
    Replies: 4
    Last Post: 05-18-2008, 11:50 PM
  2. CBitmap + big images = bad?
    By dug in forum Windows Programming
    Replies: 18
    Last Post: 06-29-2003, 12:53 AM
  3. Images
    By gvector1 in forum C++ Programming
    Replies: 7
    Last Post: 02-25-2003, 09:59 AM
  4. STL, Queues And Images
    By simly01 in forum C++ Programming
    Replies: 3
    Last Post: 06-24-2002, 01:31 PM
  5. A simple question on Images....
    By LonelyPlanetWa in forum C Programming
    Replies: 7
    Last Post: 05-20-2002, 08:34 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21