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
Page 4 of 5 FirstFirst ... 2345 LastLast
Results 31 to 40 of 44

Access some hidden features in MapPoint2002 ActiveX control

This is a discussion on Access some hidden features in MapPoint2002 ActiveX control within the MapPoint Desktop Discussion forums, part of the Map Forums category; Just a reminder to everyone. MS documentation clearly states that in VB you can use the OLE object or the ...

  1. #31
    pbeasley is offline Junior Member White Belt
    Join Date
    Apr 2003
    Posts
    1
    Just a reminder to everyone. MS documentation clearly states that in VB you can use the OLE object or the Active X control but not both. I.e., if you place a MapPointCtl object on a form and also instantiate a New MapPoint OLE object, you will get unpredictable results.

  2. #32
    baal_2000's Avatar
    baal_2000 is offline Junior Member Yellow Belt
    Join Date
    Jan 2003
    Location
    Toronto, ON, Canada
    Posts
    24
    Thanks for reminder,

    you can be sure no MapPoint OLE object is instantiated together with
    the ActiveX control.

    I did initially poorly name a VB class as 'MapPoint' and later changed it to
    'clsMapPoint' to avoid confusing similarity to MapPoint application (OLE
    object) itself.

    Sergiy.

  3. #33
    baal_2000's Avatar
    baal_2000 is offline Junior Member Yellow Belt
    Join Date
    Jan 2003
    Location
    Toronto, ON, Canada
    Posts
    24
    In reply to Extending the MapPoint ActiveX Control Question
    posted at
    http://www.mp2kmag.com/mappoint/disc...pic.asp?t=4192

    Nikos:

    The ActiveX Control is displayed in the Internet Explorer Browser, and
    you're right, it does have something to do with your problem.

    My conclusion is that the cause of the problem is the way you assign
    m_ParentWnd reference. To remind, m_ParentWnd.hwnd is
    the MapPoint control's immediate parent window's handle: in the sample
    code it is a handle of the VB frame control which contains the MapPoint.

    Unfortunately, your situation is not as conventional as in the article
    as you have your MapPoint embedded into some of internal windows of
    the IE browser window (as a guess, it is embedded into a window with
    the class name "Internet Explorer_Server"). As a general approach,
    you have to find out that container window's handle and use it in the
    place of m_ParentWnd.hwnd in

    TWnd.hWnd = m_ParentWnd.hWnd

    You can find that handle dynamically, I am sure about that
    But the task is not of easy-to-do kind. You can use the the
    article's approach:
    get the IE window, then search for its sub-windows until
    you get the container's handle. You will need to use Spy++ to
    find the windows' unique identifiers (titles/class names).

    What do you think?

    Sergiy

  4. #34
    baal_2000's Avatar
    baal_2000 is offline Junior Member Yellow Belt
    Join Date
    Jan 2003
    Location
    Toronto, ON, Canada
    Posts
    24

    Bug in TWindow

    Thanks to Bob Chase, a bug has been found in TWindow.Valid which shows up in Windows 98.

    Where the code reads

    Code:
    lRet = IsWindow(mvarhWnd)
    If (1 = lRet) Then
        Valid = True
    it should read

    Code:
    lRet = IsWindow(mvarhWnd)
    If &#40;0 <> lRet&#41; Then
        Valid = True

  5. #35
    baal_2000's Avatar
    baal_2000 is offline Junior Member Yellow Belt
    Join Date
    Jan 2003
    Location
    Toronto, ON, Canada
    Posts
    24

    MapPoint 2006:Access some hidden features in ActiveX control

    Posting the changes to MapPoint.cls file in

    http://www.mp2kmag.com/mappoint/disc...pic.asp?t=4080

    so that the demo project will work with MapPoint 2006.

    Thanks,
    Sergiy

    Code:
    Public Property Get hWnd&#40;&#41; As Long
        Dim TWnd As New TWindow
        
        If m_hWnd = 0 Then
            TWnd.hWnd = hWnd_Frame
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"AfxWnd70", vbNullString&#41;.hWnd
        
            If "Map Control" = TWnd.Caption Then
                m_hWnd = TWnd.hWnd
            End If
        End If
        hWnd = m_hWnd
    
    End Property
    
    Public Property Get hWnd_EXE&#40;&#41; As Long
        
        If m_hWnd_Exe = 0 Then
            On Error Resume Next
            m_hWnd_Exe = FindTopWindow&#40;"Afx&#58;00400000&#58;8&#58;00000000&#58;00000000&#58;05A80C17", vbNullString, False&#41;.hWnd
            Err.Clear
        End If
        
        hWnd_EXE = m_hWnd_Exe
    
    End Property
    
    Private Property Get hWnd_Frame&#40;&#41; As Long
        Dim TWnd As New TWindow
        'm_ParentWnd is a VB frame specifically designated to be the container of MapPoint control
        'This makes life easier
        
        If m_hWnd_Frame = 0 Then
            TWnd.hWnd = m_ParentWnd.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"ATL&#58;", vbNullString, False&#41;.hWnd
            If Mid$&#40;TWnd.ClassName, 9, 4&#41; = "4320" Then
                TWnd.hWnd = TWnd.FindChildWindow&#40;"ATL&#58;", vbNullString, False&#41;.hWnd
                If Mid$&#40;TWnd.ClassName, 9, 4&#41; = "40A0" Then
                    m_hWnd_Frame = TWnd.FindChildWindow&#40;"AfxFrameOrView70", vbNullString&#41;.hWnd
                End If
            End If
        End If
        hWnd_Frame = m_hWnd_Frame
    
    End Property
    
    Private Property Get hWnd_Itinerary&#40;&#41; As Long
        Dim TWnd As New TWindow
        
        If m_hWnd_Itinerary = 0 Then
            TWnd.hWnd = hWnd_Frame
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"Afx&#58;00400000&#58;8", vbNullString&#41;.hWnd
            TWnd.hWnd = TWnd.FindChildWindow&#40;"AfxWnd70", vbNullString&#41;.hWnd
        
            If "Itinerary" = TWnd.Caption Then
                m_hWnd_Itinerary = TWnd.hWnd
            End If
        End If
        hWnd_Itinerary = m_hWnd_Itinerary
    
    End Property

  6. #36
    cwrude is offline Junior Member Yellow Belt
    Join Date
    Nov 2004
    Posts
    19

    Extending MapPoint ActiveX control with MapPoint 2006

    Sergiy's modifications for MapPoint 2006 worked like a charm! Thanks Serge

  7. #37
    CONTEMPO is offline Junior Member White Belt
    Join Date
    Jul 2005
    Posts
    4
    Is there a sample code for implemting this greats features but in native .Net Framework code, not in Visual Basic 6.0

    Thanks in advanced

  8. #38
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    Without checking it is all based on PostMessage and / or SendMessage API functions. You can simply use P/Invoke to use all win32 API functions in dotNet that are not yet implemented.

  9. #39
    CONTEMPO is offline Junior Member White Belt
    Join Date
    Jul 2005
    Posts
    4
    Thanks

    I would like to have this project done in dotNet code. All classes necessary implemented in the Visual Basic project translate to dotNet code in a dll.

    But I donīt know how start and do it easily.

    Another issue, this project works with MapPoint 2006?

    Thanks in advanced

  10. #40
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    Hi,

    To use all the missing win32 API functions in dotNet, you have to declare them yourself. This can be done creating a singleton class where you declare them in using the right dll. I have a small class in C# for the most importand ones, but I assume the syntax is very different in VBnet.

Page 4 of 5 FirstFirst ... 2345 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. MS Access Mappoint ActiveX
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 05-21-2005, 06:31 PM
  2. Re: Keyboard control in mappoint activex control
    By djcapslock in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 03-10-2005, 11:16 AM
  3. MS Access and Mappoint ActiveX Control
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 06-26-2004, 02:29 PM
  4. Using MP ActiveX Control in Access/Foxpro etc
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 02-21-2003, 12:51 PM
  5. Hi EB Can i use the Map point control features ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-14-2002, 03:03 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