MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Delphi and ShowModal() problem

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, ...


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 (3) Thread Tools Display Modes
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 11-13-2006
Junior Member
White Belt
 
Join Date: Nov 2006
Posts: 5
Delphi and ShowModal() problem

Hey,

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
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 11-13-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,123
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;
This is the constructor:

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;
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
delphi, problem, showmodal


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/delphi-showmodal-problem-5351.html

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

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


All times are GMT -5. The time now is 01:15 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, 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 55