MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




DataSet.Paste: Exception from HRESULT: 0x80040E04 (vb.NET)

This is a discussion on DataSet.Paste: Exception from HRESULT: 0x80040E04 (vb.NET) within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Below is a code snippet that takes lat/lon data from a database and plots it on MapPoint 2004. This sub ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-04-2005
Junior Member
White Belt
 
Join Date: Sep 2004
Posts: 5
DataSet.Paste: Exception from HRESULT: 0x80040E04 (vb.NET)

Below is a code snippet that takes lat/lon data from a database and plots it on MapPoint 2004. This sub randomly returns the error message "HRESULT 0x80040E04". I have pulled all I can from the exception object:

Method: Paste
StackTrace: at MapPoint.DataSet.Paste()
Message: Exception from HRESULT: 0x80040E04

Has anyone seen this before? Any suggestions?

Thanks,
Thomas

Dim oMap As MapPoint.Map
Dim oLoc As MapPoint.Location
Dim oPushpin As MapPoint.Pushpin
Dim oDS As MapPoint.DataSet
Dim oRoute As MapPoint.Route

'Query Database
sdst = SqlHelper.ExecuteDataset(UserSettings.ConnString, "getMobileHistory", SqlHelper.ExecuteScalar(UserSettings.ConnString, "getMobileIDFromName", Mobile), CDate(dt1.Text & " " & dt2.Text), CDate(dt3.Text & " " & dt4.Text), eList)

'Initialize MapPoint objects
oMap = Map.MapCtl.ActiveMap
oMap.Saved = True
oRoute = oMap.ActiveRoute

'Set Up Map for pushpin dataset
oMap.DataSets.AddPushpinSet(Mobile)
oDS = oMap.DataSets(Mobile)
oDS.Symbol = 256
oDS.Select()

'cycle through DataSet
For jj = 0 To sdst.Tables(0).Rows.Count - 1
latitude = sdst.Tables(0).Rows(jj).Item(2)
longitude = sdst.Tables(0).Rows(jj).Item(3)
oLoc = oMap.GetLocation(latitude, longitude, 1)
oRoute.Waypoints.Add(oLoc, CStr(i + 1))
oPushpin = oMap.AddPushpin(oLoc)
oPushpin.Note = "Vehicle: " & Mobile & vbNewLine & _
"Time: " & LogTime & vbNewLine & _
"Event: " & EventName & vbNewLine & _
"Heading: " & Heading & vbNewLine & _
"Speed: " & Speed & vbNewLine
oPushpin.Name = i
oPushpin.Symbol = symbol
oPushpin.Cut()
oDS.Paste()
i = i + 1
Next
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 03-09-2005
Junior Member
White Belt
 
Join Date: Sep 2004
Posts: 5
Anyone seen this error before? Suggestions on catching it and recovering?

Thomas
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 03-10-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

Difficult to say. But.. there is no such thing as 'random error' in software. It will happen in a certain condtion. However with a loose pointer it can be more or less random (in time).

You have to find out first witch line of code is the offending one. Then when you know that you can search for the differences.
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 03-10-2006
citrix_99301's Avatar
Junior Member
White Belt
 
Join Date: Mar 2006
Posts: 11
Exception from HRESULT: 0x80040E04

Hi,

I'm getting the same "seemingly random" error when the program attempts to build a recordset out of all the pushpins in a dataset.

If the user tries the same exact thing, the next time it's likely to go through with no problems.

Does anybody have any ideas?

Andre Ranieri



oRS = oDS.QueryAllRecords();
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 03-14-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

I never had this error, but from what I see in the message: HRESULT, is telling me that Result is a windows handle. So could be that a certain handle is overwritten, or used by another thread (if your program is multithread).

I always liked to debug the 'seemignly random' errors from colleguas of me, to show them that there is no sutch thing as 'random' But I have to cofess it is somethime difficult...

To begin with if you have multiple threads, go single thread and see if you have still the same problem. Then simplify until you have a demo with no more code to show the problem. By then you probably have found it yourself, but pleas feedback here

Sorry but that is really all the help I can give ...
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


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
OutOfMemory Exception Gianmaria MapPoint 2006/2009 Discussion 1 01-24-2006 12:26 PM
Regarding COM exception at the end of execution... Anonymous MP2K Magazine Articles 0 05-12-2005 12:23 PM
Cut and Paste Problem with Word 2003 and MapPoint 2004 brubli MapPoint 2006/2009 Discussion 0 10-21-2004 04:26 PM
Dataset Copy/Paste indmillert MapPoint 2006/2009 Discussion 3 11-10-2003 04:10 PM
Problems with copy and paste of user-defined territories Ute MapPoint 2006/2009 Discussion 2 04-14-2003 11:38 AM


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


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Menorca Flights
Visit the unspoilt Mediterranean island of Menorca. Menorca flights are low cost flights when you book with Holiday Hypermarket.

Flights to Spain
Find cheap flights to Spain on Travel Counsellors. A personal Travel Counsellor can help you plan flights and find accommodation in Spain.

Thailand Holidays
Thailand Holidays can suit your budget when you book with dealchecker.co.uk. If you are strapped for cash, visit online to find the deal for you.

Jamaica Holidays
Jamaica holidays give you the chance to enjoy the vibrant cultural heritage and wonderful laid back atmosphere of the Caribbean. Book here!

Egypt
In Egypt you find an ancient city buzzing with life. There is an abundance of historical sites to see, not just the pyramids. The Opera House is certainly worth a visit and you can enjoy some open-air theatre too.

Cheap Travel
Travel.co.uk has some excellent offers on cheap travel. Click here.

Cheap Sharm el Sheikh Holidays
Visit the Red Sea Riviera! Info on cheap Sharm el Sheikh holidays, found at On The Beach.


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