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 10 of 10

Problems with ShowFindDialog

This is a discussion on Problems with ShowFindDialog within the MapPoint Desktop Discussion forums, part of the Map Forums category; The first problem is that ShowFindDialog uses regional settings to determine country instead of passing a parameter to it. Is ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Problems with ShowFindDialog

    The first problem is that ShowFindDialog uses regional settings to determine country instead of passing a parameter to it. Is there any member of the map object, or control object that I can specify the country in?

    Second, when I call ShowFindDialog, if it takes more than 5 seconds for the user to resolve an address, I get stuck in a loop of Retry/Switch-To. I've had similar problems when I took too long running code on mouse events. But this is a MapPoint function that I've called. Once I've called this (from a non-MapPoint generated event), I can't control it. I can only wait for the user to dismiss it.

    Any suggestions? I'm using VC++, so that complicates things (since 99% of all MapPoint info is in VB). I can't seem to find a way to change OLE timeouts in VC++ (if there is a way).

    That reminds me, if anyone has an idea how to 'extend MapPoint functionality' in VC++ (like has been done in VB), I would appreciate help with that too. I've tried posting the appropriate messages to the control's parent, its parent, the frame, etc. I know it should be sent to the map's outermost window, but which one is that?

    Argh! Thanks to anyone who can help!

  2. #2
    DrNobody is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    10

    Re: Problems with ShowFindDialog

    Hi.
    I have the same problem. Did You find solution?

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Problems with ShowFindDialog

    Hi,

    The original poster declares several problems which I dont fully understeand. Can you please enlighten yours ?

  4. #4
    DrNobody is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    10

    Re: Problems with ShowFindDialog

    Quote Originally Posted by Wilfried View Post
    Hi,

    The original poster declares several problems which I dont fully understeand. Can you please enlighten yours ?

    Hi, Wilfried.
    When I invoke ShowFindDialog, in 5 - 7 sec., I get stuck in a loop of Retry/Switch-To (Server is busy). I've had similar problems when I took too long running code on mouse events or use MessageBox. But this is a MapPoint function that I've called. I can only wait for the user to dismiss it.

    I'm using MSVC++ 2005 & MSVC++ 6.0 The results are the same.

  5. #5
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Problems with ShowFindDialog

    Hi,

    You probably call it from within a MapPoint event. You cannot display a modal form in an event for longer than 10 seconds, even if it is a MapPoint form.

    Solution is to call it outside an event. The best way is to post a message to a custom message handler. Your custom message handler then will execute outside the event and then the problem is gone.

    Same thing for lenghty code or your own dialogs or menu's.

    Note that you can do the same with a Timer but this is considered as not a good programming technique.

  6. #6
    DrNobody is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    10

    Re: Problems with ShowFindDialog

    Quote Originally Posted by Wilfried View Post
    Hi,

    You probably call it from within a MapPoint event. You cannot display a modal form in an event for longer than 10 seconds, even if it is a MapPoint form...
    Hi.

    No. I have a simple dialog based test application. On the dialog are MapPoint ActiveX ctrl and some buttons. I call ShowFindDialog from ButtonClick message handler:
    Code:
    voidCPOI_TestDlg::OnBnClickedFindBtn()
    {
    
    
    try
    {
    CMap1 dispActiveMap = m_wndMapPointCtrl.GetActiveMap();
    dispActiveMap .ShowFindDialog( _T(""), geoFindAddress, (long)(m_wndMapPointCtrl.GetSafeHwnd()), FALSE);
    //or
    //dispActiveMap .ShowFindDialog( _T(""), geoFindAddress,
    // (long) GetSafeHwnd(), FALSE);
    //or
    //dispActiveMap .ShowFindDialog( _T(""), geoFindAddress,
    // NULL, FALSE);
    //The results are the same
    } catch (COleDispatchException * pExpn) {
    pExpn->ReportError ();
    pExpn->Delete ();
    }
    }
    In the same time Ctrl+F on the MapPoint calls this dialog without any problems.

  7. #7
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Problems with ShowFindDialog

    Hi,

    I just did same test:

    Code:
    MP.ActiveMap.ShowFindDialog(street, GeoFindState.geoFindAddress, 0, false);
    And wait around a minute while the dialog was modal. Nothing happened.

    Maybe some other code is executing because the the dialog is a modal form and so it is pumping messages. Also some events are fired, for example if street is a valid street then SelectionChange is fired at that moment. Maybe some other events too, I did not check.

  8. #8
    DrNobody is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    10

    Re: Problems with ShowFindDialog

    I did it in C#. No problem. But I need in VC++

  9. #9
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Problems with ShowFindDialog

    Hi,

    Very strange. And you are absolutely sure no event is executed where something else takes time ?

    If yes then there is something wierd in VC++ with that function. Then best is to show your own dialog I think.

  10. #10
    DrNobody is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    10

    Re: Problems with ShowFindDialog

    Quote Originally Posted by Wilfried View Post
    Hi,

    Very strange. And you are absolutely sure no event is executed where something else takes time ?

    If yes then there is something wierd in VC++ with that function. Then best is to show your own dialog I think.
    Hi.
    I'm sure that no event is executed where something else takes time. Application has only one Dialog wnd with MP & Button and handler for BtnClick. That's all.
    But I found acceptable solution:
    FindWindow or EnumChildWindows untill "AfxFrameOrView70" found and PostMessage. (article of Sergey Pavlov, thanks)

    Thank You.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Complete adress, when using ShowFindDialog?
    By Jarun in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 04-11-2005, 02:31 PM
  2. Object returned by ShowFindDialog
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-15-2004, 11:00 AM
  3. Problems with ShowFindDialog function in C++
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-06-2003, 05:13 AM
  4. ShowFindDialog not quite as modal as it should
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 04-07-2003, 04:17 AM
  5. Starting showfinddialog with other country name???
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-24-2003, 04:26 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