MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Error in calling "get_streetAddress"

This is a discussion on Error in calling "get_streetAddress" within the MapPoint 2006/2009 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 ...


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 Thread Tools Display Modes
  #1 (permalink)  
Old 06-22-2006
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
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 06-22-2006
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 916
Blog Entries: 11
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
See the Geoweb Guru for online mapping
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 06-22-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,123
Re: Error in calling "get_streetAddress"

Hi,

Quote:
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 06-22-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,123
Hi Richard,

Quote:
(eg. I don't know how Delphi handles COM objects - releasing them,etc)
Like in C. Create / destroy is the coder responcability
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 06-22-2006
Winwaed's Avatar
Mapping-Tools.com
Red Belt
 
Join Date: Feb 2004
Posts: 916
Blog Entries: 11
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
See the Geoweb Guru for online mapping
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 06-23-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,123
Hi Richard,

Yes you are right. He must something do as:

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

Code:
if Assigned(Item) then
   Item.CallMethod;
Both are the same.
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
calling, error, getstreetaddress


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
Getting "unspecified error" in VB during FindAddre mschoonmaker MapPoint 2006/2009 Discussion 5 06-12-2006 02:11 PM
MapPoint OLE error: "Could not update object" wiecho_k MapPoint 2006/2009 Discussion 1 07-23-2005 11:53 AM
Error "overflow execution stack" while readinq a Anonymous MapPoint 2006/2009 Discussion 5 02-18-2005 02:47 PM
Do I need "Autoroute Europe", if I install "M bigtail MapPoint 2006/2009 Discussion 1 03-24-2004 12:58 AM
error 16398 with NT service "localsystem" arsenic77 MapPoint 2006/2009 Discussion 3 06-19-2003 11:37 AM


All times are GMT -5. The time now is 11:06 PM.


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