Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Problem method Map.copymap() in visual basic .net 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 |
| |||
|
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) |
![]() |
| Tags |
| basic, mapcopymap, method, net, problem, visual |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |