Community of VE/MapPoint Users and Developers
This is a discussion on Delphi and ShowModal() problem within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hey, I have following problem: I have an application with several forms. On the main form I put an OleContainer, ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Delphi and ShowModal() problem I have following problem: I have an application with several forms. On the main form I put an OleContainer, and in this olecontainer, I run MapPoint. This works fine. But when I want to show a form using ShowModal() (I'm using BCB6 C++), the modal form is shown behind the main form (and as the mainform is disabled because the other form is modal,the entire application is stuck). I know for sure that it's the MapPoint in the olecontainer that causes the problem. Does anyone has the same problems? Or better: does anyone know how to solve this? Thanks in advance! Gianluca |
| |||
| Re: Delphi and ShowModal() problem
Hi, Hmm I have had that problem, but I forgot what the fix was. Please try following constructor and creation. Put a Panel on your form, name it MPPanel and use following code: Code: procedure TForm1.Button1Click(Sender: TObject); begin MP := TMP.Create(Self, MPPanel); end; Code: constructor TMP.Create(AOwner: TComponent; ParentControl: TWinControl);
var
vGuid: TGuid;
begin;
OleContainer := TOleContainer.create(AOwner);
OleContainer.Width := ParentControl.Width;
OleContainer.Height := ParentControl.height;
OleContainer.Parent := ParentControl;
OleContainer.CreateObject('MapPoint.Map.EU.11',False);
OleContainer.DoVerb(1);
OleContainer.OleObjectInterface.GetUserClassID(vGuid);
OleContainer.Align := alClient;
FMap:= IDispatch(OleContainer.OleObject) as map;
end;
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| delphi, problem, showmodal |
| ||||
| Posted By | For | Type | Date | |
| Microsoft MapPoint 2006 - MP2K Magazine | This thread | Refback | 11-21-2006 04:03 AM | |
| Author - MP2K Magazine | This thread | Refback | 11-21-2006 01:30 AM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 11-20-2006 08:16 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mappoint in OleContainer problem //Delphi | Anonymous | MapPoint 2006/2009 Discussion | 6 | 01-08-2005 02:03 PM |
| OleVariant Problem with Delphi 6 | top204 | MapPoint 2006/2009 Discussion | 3 | 04-29-2004 05:51 AM |
| Delphi OleContainer Resize Problem. | Sheridan | MapPoint 2006/2009 Discussion | 5 | 12-19-2003 06:50 AM |
| Delphi | Anonymous | MapPoint 2006/2009 Discussion | 2 | 12-18-2003 12:11 PM |
| ShowModal hides form with MP in olecontainer | Anonymous | MapPoint 2006/2009 Discussion | 0 | 05-13-2003 11:50 AM |