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 3 of 3

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

This is a discussion on Problem method Map.copymap() in visual basic .net within the MapPoint Desktop 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 ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    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

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    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)

  3. #3
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    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

Thread Information

Users Browsing this Thread

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

Similar Threads

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