BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OleContainer, Mouse events, how to get the callback

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Johanna Leimer
Guest





PostPosted: Sun Sep 05, 2004 9:10 pm    Post subject: OleContainer, Mouse events, how to get the callback Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.