Thread: Refreshing images

  1. #1
    Registered User
    Join Date
    Feb 2010

    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:

    				case IDC_SUN:
    					HRESULT hr = URLDownloadToFile ( NULL, _T(""), _T("c:/Documents and Settings/XP/My Documents/latest.bmp"), 0, NULL );
    					DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_SUNPAGE), hwnd, ToolDlgProc);
    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?


  2. #2
    Registered User
    Join Date
    Feb 2010
    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:


    IDB_SUNPIC        BITMAP         "C:\\Documents and Settings\\XP\\My Documents\\latest.bmp"

        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, 10:50 PM
  2. CBitmap + big images = bad?
    By dug in forum Windows Programming
    Replies: 18
    Last Post: 06-28-2003, 11:53 PM
  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, 12:31 PM
  5. A simple question on Images....
    By LonelyPlanetWa in forum C Programming
    Replies: 7
    Last Post: 05-20-2002, 07:34 AM