Community of VE/MapPoint Users and Developers
This is a discussion on MapPoint 2004 and Delphi 5 within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi there, I'm using MP2004 in delphi 5. My application uses an OleContainer that initialise MP 2004 in this way: ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| MapPoint 2004 and Delphi 5 I'm using MP2004 in delphi 5. My application uses an OleContainer that initialise MP 2004 in this way: OleContainer1.CreateObject('MapPoint.Map.EU.11', False); OleContainer1.DoVerb(ovPrimary); OleContainer1.OleObjectInterface.GetUserClassID(vG uid); FMap := IDispatch(OleContainer1.OleObject) as _Map; In the main form i introduce some components like textbox, buttons, Memo etc. and several times, when I shutdown the application, I have this message: "Project1 has raised exception class EAccessViolation with message ' Access Violation at address 77ADCA82 in module "ole32.dll". Read of Address 00C2762C'. Process Stopped. Use Step or Run to Continue." The addresses are the same everytime the exception comes up. When I insert new buttons or textbox the exception raises; when I remove the new components the Exception does not raise. It's very strange; could someone help me? Thanks in advance. |
| |||
| MapPoint and D5
I tried to set FMAP := nil in the "OnClose" event of the main form but nothing changes. For example: I inserted a TCustomWinSocket component on the form and the exception raised up. When removed the component the exception did not raise. Could it be the OLE container? |
| |||
| exception olecontainer + winsock
yeah, i have the same problem in c++ builder 6. i have a form with mappoint running in a olecontainer. opening and closing the complete application works without any error. when i add a winsock component to the form, i get an exception after closing the form. when i remove the winsock component, everything seems to be OK. what is going on here? |
| |||
|
Hi, maybe it is the olecontainer?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| My Solution
I think this is something to do with components notifying each other when they are freed. The form is the owner of components that are created automatically and, as far as I can remember, when each component on the form is freed every other component on the form is notified. I think the ActiveX object might not be able to cope with knowing about components in the application being freed. My solution was to create the TOLEContainer at run time and set its owner to its parent. This stopped the access violations. My code for doing this was: Code: OleContainer := TOleContainer.Create(PMap); //PMap is a panel
OleContainer.Parent := PMap;
OleContainer.Align := alClient;
OleContainer.CreateObject('MapPoint.Map.EU', False);
|
![]() |
| Tags |
| delphi, mappoint 2004 |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mappoint 2004 ActiveX Delphi 2005 How to add a Polyline | it-fraggel | MapPoint 2006/2009 Discussion | 3 | 04-04-2006 02:23 PM |
| Using MapPoint In Delphi | Anonymous | MP2K Magazine Articles | 8 | 12-05-2005 10:51 AM |
| Mappoint 2004 Control in Delphi | Anonymous | MapPoint 2006/2009 Discussion | 4 | 10-02-2003 04:55 PM |
| How to get mappoint Active X in Delphi? | jmiller55 | MapPoint 2006/2009 Discussion | 1 | 07-31-2003 10:54 PM |
| Mappoint With Delphi 5 | stuarth | MapPoint 2006/2009 Discussion | 1 | 04-08-2003 11:21 AM |