Help for a delphi program

tontaegu
08-19-2005, 01:55 AM
I should make a program in Delphi to show a route with a list of destinations.
I need an example to begin.
Thanks

Mohamed
08-19-2005, 03:43 AM
Hi,

You should use "Search" engine here ! :idea:
You will find a lot of topics concerning Delphi.
as http://www.mp2kmag.com/a65--delphi.example.mappoint.html
( Is Delphi easy to use ? )

Rgds

Wilfried
08-19-2005, 01:53 PM
Hi Mohamed,

Is Delphi easy to use ?

Yes very easy, very type structured, but you can typecast everyting what you wants. It is very high level, but you can go to low level programming if needed without problem, and it support inline assembler.

tontaegu
08-23-2005, 02:40 AM
I already read the example nr 65 and other examples in the forum, but they are not sufficient for my use. I'm searching for an example to design a route with a list of 10-20 address and to know the cost,price and distance.

Wilfried
08-23-2005, 04:50 AM
Hi,

Thisi is how to calc a route from an address in Delphi:

var
RT: Route;
Loc: Location;
Results: FindResults;
i: OleVariant;
begin
RT := FMap.ActiveRoute;
RT.Clear;
i := 1;

Results := FMap.FindAddressResults(Street1, Place1, '', '', PostC1, GeoCountryBelgium);
if Results.ResultsQuality = geoNoResults then
Exit;
Loc := Location(Results.Item[i]);
RT.Waypoints.Add(Loc, '');

Results := FMap.FindAddressResults(Street2, Place2, '', '', PostC2, GeoCountryBelgium);
if Results.ResultsQuality = geoNoResults then
Exit;
Loc := Location(Results.Item[i]);
RT.Waypoints.Add(Loc, '');

RT.Calculate;

Wilfried
08-23-2005, 09:15 AM
Hi,

It works!
Do you know how to set parameters of speed, starting time, cost x litres and preference route?

RT.DriverProfile.PreferredRoads[geoRoadInterstate] := 0.8;
RT.DriverProfile.PreferredRoads[geoRoadStreet] := 0.5;
// etc
RT.DriverProfile.Speed[geoRoadInterstate] := 160;
RT.DriverProfile.Speed[geoRoadStreet] := 50;
// etc

You find some other membersin the Route and Driverprofile objects to set.

Dexter
09-20-2005, 08:02 AM
I have tried your code in delphi and it comes up with the error : EoleSysError with message 'Class not registered'

Wilfried
09-20-2005, 12:24 PM
Hi,

What is the offending line of code ?

Dexter
09-20-2005, 04:38 PM
I get a Invalid Class String from this line of code :


OleContainer.CreateObject('MapPoint.Map.EU.11', False);


Any ideas ow to fix it, i have copied the example from http://www.mp2kmag.com/a65--delphi.example.mappoint.html

Wilfried
09-21-2005, 12:14 PM
Hi,

did you include Mappoint_TLB in the uses clause ?

Dexter
09-21-2005, 12:39 PM
Yes I did

Wilfried
09-22-2005, 02:20 PM
Hi,

private mai lme your application. Please only relevant code, only soourse and no 3th party compoentnts. I try to check what is wrong.

Dexter
09-23-2005, 09:12 AM
I found out what the problem was, it was my shit pc! I installed it on another pc and the code works fine!

Wilfried
09-24-2005, 02:03 PM
Hi,

Thx for feedback. Still it is interesting to know (for you also) what exacly the reason was it not working.

 
Web mp2kmag.com
mapforums.com