MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Problem method Map.copymap() in visual basic .net

This is a discussion on Problem method Map.copymap() in visual basic .net within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi everybody, I'm upgrading an application using Mappoint COM from VB6 to VB.NET. In old application the method copymap() runs ...


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 10-20-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Problem method Map.copymap() in visual basic .net

Hi everybody,

I'm upgrading an application using Mappoint COM from VB6 to VB.NET. In old application the method copymap() runs perfectly, but in VB.NET it doesn't work very well.

When I call this method not always copy the image to clipboard. See this code:

Dim iData As IDataObject = Clipboard.GetDataObject()
Dim bmpScreen As System.Drawing.Bitmap
Dim Pepe() As String

FrmPrincipal.MPC_.ActiveMap.CopyMap()

Pepe = iData.GetFormats()

If iData.GetDataPresent(DataFormats.Bitmap) Then
' Yes it is, so store it in the file.
bmpScreen = CType(iData.GetData(DataFormats.Bitmap), _
System.Drawing.Bitmap)
bmpScreen.Save(Application.StartupPath & "\foto.bmp")
Else

' If not correct format, error message.
' I don't see how this could possibly
' happen, by the way.
MsgBox("The map is not in the clipboard")
End If


It doesn't works always, it seems that mappoint is busy and not copy to the clipboard.

Anybody knows solution for it?

This feature is very important for my application, and in VB6 it runs very well...

Thank you very much, and sorry for my english

Victor
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 10-21-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Just a thought, but check to see if you are running as MTA (multiple threaded apartment) instead of STA (are you running this is a separate thread from your main thread?)

MTA won't allow OLE actions. You can however use the WINAPI clipboard...(I have the code if you need it)
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 10-28-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
I don't know what can I check the threading mode, but if you can send me the code to use win clipboard api I will be very pleased

Thank you very much , Victor
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
basic, mapcopymap, method, net, problem, visual


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
Drawing a polyline with Visual Basic Net - Array problem Anonymous MapPoint 2006/2009 Discussion 0 03-24-2005 05:16 PM
Visual Basic 6.0 Anonymous MapPoint 2006/2009 Discussion 1 08-06-2004 07:17 AM
Visual Basic 6.0 fantef MapPoint 2006/2009 Discussion 0 04-15-2004 12:41 PM
mappoint, visual c++ vs visual basic Anonymous MapPoint 2006/2009 Discussion 6 03-30-2004 10:17 PM
Visual basic or visual c++ in mappoint misterb83 MapPoint 2006/2009 Discussion 1 02-14-2003 09:31 AM


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


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


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