MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Problems with ShowFindDialog

This is a discussion on Problems with ShowFindDialog within the MapPoint 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-21-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-16-2007
Junior Member
White Belt
 
Join Date: Feb 2007
Posts: 10
Re: Problems with ShowFindDialog

Hi.
I have the same problem. Did You find solution?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-16-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: Problems with ShowFindDialog

Hi,

The original poster declares several problems which I dont fully understeand. Can you please enlighten yours ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 03-17-2007
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 03-17-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 03-19-2007
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 03-19-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 03-19-2007
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++
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 03-20-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 03-20-2007
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
problems, showfinddialog


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Complete adress, when using ShowFindDialog? Jarun MapPoint 2006/2009 Discussion 3 04-11-2005 02:31 PM
Object returned by ShowFindDialog Anonymous MapPoint 2006/2009 Discussion 0 04-15-2004 11:00 AM
Problems with ShowFindDialog function in C++ Anonymous MapPoint 2006/2009 Discussion 1 10-06-2003 05:13 AM
ShowFindDialog not quite as modal as it should Anonymous MapPoint 2006/2009 Discussion 4 04-07-2003 04:17 AM
Starting showfinddialog with other country name??? Anonymous MapPoint 2006/2009 Discussion 2 01-24-2003 04:26 PM


All times are GMT -5. The time now is 11:21 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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