Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 6 of 6

Error in calling "get_streetAddress"

This is a discussion on Error in calling "get_streetAddress" within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hello, May somebody help me? I'm making a program in Delphi6 and MapPoint2004 and I used exactly the example in ...

  1. #1
    dgaranz is offline Junior Member White Belt
    Join Date
    Jun 2006
    Posts
    1

    Error in calling "get_streetAddress"

    Hello,
    May somebody help me?

    I'm making a program in Delphi6 and MapPoint2004 and
    I used exactly the example in the code found at
    http://www.mp2kmag.com/a80--delphi.a....mappoint.html.


    function TFMain.Controll_Address(address:string):string;
    02 var
    03 ret:string;
    04 r:FindResults;
    05 o:OleVariant;
    06 item:location;
    07 line, street,city1,city2,region,postalcode:string;
    08 country:Olevariant;
    09 begin
    10 line:=address;
    11
    ......
    ....
    r:=Mapp.ActiveMap.FindAddressResults(street,city1, city2, region, postalcode, country);
    20
    21
    22
    23 if r.Count>0 then
    24 begin
    25 o:=1;
    26 item:=r.get_item(o) as location;
    27 ret:=
    28 item.Get_StreetAddress.Get_Street+','+ ......

    WHEN I call the function Get_streetAddress.Get_street or get_city
    I have a "Access violation at address 0045FE5C. Read of address 000000.

    Thanks

  2. #2
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    Do you know which line the Access Violation occurs on?

    I don't know Delphi but do know some Pascal. It was pre-COM, so I may only be able to provide limited help.
    (eg. I don't know how Delphi handles COM objects - releasing them,etc)


    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  3. #3
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Error in calling "get_streetAddress"

    Hi,

    Read of address 000000
    this means that you try to read at an addrss containing a null pointer. Eventually you can sset the debugger on 'break on exceptions' to see the offending line, or 'search' - 'find error' to go to the address pointer where the exception occure.

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi Richard,

    (eg. I don't know how Delphi handles COM objects - releasing them,etc)
    Like in C. Create / destroy is the coder responcability

  5. #5
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    If the rror is at the last line, it might be because the list of locations probably includes some location objects which do not have their streets setting.

    Location have a number of different properties and they are not necessarily all set!
    Eg. if the Location object represents a country (and only a country) then none of the other proeprties will be set.

    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi Richard,

    Yes you are right. He must something do as:

    Code:
    if Item <> nil then
       Item.CallMethod;
    or

    Code:
    if Assigned&#40;Item&#41; then
       Item.CallMethod;
    Both are the same.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Getting "unspecified error" in VB during FindAddre
    By mschoonmaker in forum MapPoint Desktop Discussion
    Replies: 6
    Last Post: 07-24-2010, 04:49 PM
  2. MapPoint OLE error: "Could not update object"
    By wiecho_k in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-23-2005, 11:53 AM
  3. Error "overflow execution stack" while readinq a
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 02-18-2005, 02:47 PM
  4. Do I need "Autoroute Europe", if I install "M
    By bigtail in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-24-2004, 12:58 AM
  5. error 16398 with NT service "localsystem"
    By arsenic77 in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 06-19-2003, 11:37 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 56 57 58 59 60 61 62 63 64 65 66