 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Johanna Leimer Guest
|
Posted: Sun Sep 05, 2004 9:10 pm Post subject: OleContainer, Mouse events, how to get the callback |
|
|
I want to use Microsoft MapPoint to display maps and let the user click on
them to place Pushpins. The MapPoint documentation says that there is a
BeforeClick event that can be used for such things. Unfortunately, they
don't say how to do it in Delphi only for VisualBasic:
############################################################################
###
The following code shows in VisualBasic how to move the map to the place the
user clicked on:
Dim WithEvents oMap As MapPoint.Map
Private Sub Form_Load()
Set oMap = GetObject(, "MapPoint.Application").ActiveMap
End Sub
Private Sub oMap_BeforeClick(ByVal Button As Long, _
ByVal Shift As Long, ByVal X As Long, _
ByVal Y As Long, Cancel As Boolean)
Dim oResults As MapPoint.FindResults
Cancel = True ' Don't do the normal click behaviour
Dim oLoc As MapPoint.Location
Set oLoc = oMap.XYToLocation(X, Y)
If Not (oLoc Is Nothing) Then oLoc.GoTo
End
Sub#########################################################################
######To use a map in Delphi you have to place an OleContainer on a form in
which the map can be displayed. The OleContainer is just a container so I
cannot expect to find the BeforeClick event there. Therefore my
questions:How do I get the Map object to call my callback routine in case
the user clicks on the map. I suppose there must be a way to query the Map
and find the defined event sources. Do I have to use
IConnectionPointContainer? If yes how is that done?
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|