Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 5 of 5

Sluggish refresh on startup

This is a discussion on Sluggish refresh on startup within the Development forums, part of the MapPoint Desktop Discussion category; Hi All, I've been experiencing a problem where *sometimes*, the MapPoint control seems to not draw itself, or only perform ...

  1. #1
    208_Fireball is offline Junior Member White Belt
    Join Date
    Apr 2004
    Posts
    10

    Sluggish refresh on startup

    Hi All,

    I've been experiencing a problem where *sometimes*, the MapPoint control seems to not draw itself, or only perform a partial draw (say the Microsoft logo with no map.)

    Has anyone else seen this and/or come up with graceful ways to detect and invalidate in this situation?

    I created a bare-bones test application, which is a Visual Studio 6.0 C++ MFC dialog with the statically linked mfc dll. It includes the OnUIDeactivate fix from these forums ( Map Point ActiveX in MFC View (MDI application) ), opens a new US map, and that's it.
    The test application exhibits the problem.
    I've attached the whole test source, including exes, but not the intermediate source (for size reasons) if anyone is interested. *You'll need MapPoint North America installed before you run the application.* Also, I've included a sample image of a good startup window (includes map), and one of a bad startup window (no map.)

    Cheers,

    Dave
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Mattys Consulting's Avatar
    Mattys Consulting is offline Senior Member Black Belt
    Join Date
    Dec 2002
    Posts
    1,040

    Re: Sluggish refresh on startup

    Hi Dave,

    Yep, I have that problem. I used UpdateWindow on the whole heirarchy
    and SetFocus, as well. No solution so far. I'll figure it out eventually ...

    Mike Mattys

  3. #3
    208_Fireball is offline Junior Member White Belt
    Join Date
    Apr 2004
    Posts
    10

    Re: Sluggish refresh on startup

    It's both good and bad that you share my pain!

    Invalidate(TRUE) on the main dialog seems to be able to recreate the refresh problem every time.

    I wonder if we can override OnEraseBkgnd in the Generated Mappoint control class, and do something there to fix it? (Providing the file's backed up, in case Studio regenerates the file.)

    Cheers,

    DaveH

  4. #4
    208_Fireball is offline Junior Member White Belt
    Join Date
    Apr 2004
    Posts
    10

    Re: Sluggish refresh on startup

    Well, if you find the actual map window of the MapPoint control (by using Spy++ or similar), and send it an Invalidate(FALSE) in the MapPoint control's OnEraseBkgnd function, before the call to the base CWnd::OnEraseBkgnd(pDC), it seems to fix the refresh - with no side effects noticed (so far.)

    Cheers,

    Dave

  5. #5
    208_Fireball is offline Junior Member White Belt
    Join Date
    Apr 2004
    Posts
    10

    Re: Sluggish refresh on startup

    Also,

    Edit: Note that MapPoint 2006's internal map window is in a different location to that of 2002 and 2004.

    Here's my simple code, generated after using Spy++ :
    Code:
    	if (nVersion == 13) {
    		hwndMapCtrlHandle = FindWindowEx((HWND) *pWndChild,0,"AfxFrameOrView70", NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:00400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:00400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:00400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:00400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:00400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:00400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:00400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AfxWnd70","Map Control");
    	} else if ((nVersion == 11) || (nVersion == 9)) {
    		hwndMapCtrlHandle = FindWindowEx((HWND) *pWndChild,0,"AfxFrameOrView42", NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AFX:400000:8",NULL);
    		hwndMapCtrlHandle = FindWindowEx(hwndMapCtrlHandle,0,"AfxWnd42","Map Control");
    	}
    Please let me know if this has been of use to any of you!

    Cheers,

    Dave

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MapPoint Map Refresh
    By andreaplanet in forum MapPoint Desktop Discussion
    Replies: 11
    Last Post: 11-29-2006, 05:07 AM
  2. Each startup: installation, configuring, gathering info
    By terryww in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-29-2005, 03:38 PM
  3. How can I refresh the data link from VB
    By flymoe in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-21-2004, 07:46 AM
  4. prog hangs on startup
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-18-2004, 09:50 AM
  5. How to refresh a Map
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-03-2003, 04:42 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85