PDA

View Full Version : PushPin Selection detection in Delphi?



shadbell
12-16-2003, 09:21 AM
When the OnSelectionChange event is fired I would like to be able to determine if the NewSelection is a PuchPin Object. Is there a way to figure this out. What I would ultimitely like to do is to display the Street Address in a status bar. I appreciate any help.

Mossoft
12-17-2003, 09:38 AM
Dont do delphi but...

In VB:
If TypeOf pNewSelection Is Pushpin Then
.......................
end if

OR

If TypeName(pNewSelection) = "Pushpin" then
.....................
end if


M.

lynx
12-18-2003, 10:02 AM
When the OnSelectionChange event is fired I would like to be able to determine if the NewSelection is a PuchPin Object. Is there a way to figure this out. What I would ultimitely like to do is to display the Street Address in a status bar. I appreciate any help.
First off.. a quick note.. anything that returns a IDispatch interface usually means it can be one of many things. You can allways refer to the help at msdn.microsoft.com for a list of the things it can be.

Now for the solution :) (assuming the SelectionChange event)



var
oPushpin: Pushpin;
begin
if assigned(pNewSelection) then
begin
pNewSelection.QueryInterface(IID_Pushpin, oPushpin);
if assigned(oPushpin) then
Showmessage('It's a pushpin!')
else
Showmessage('It's NOT a pushpin.');
end;
end;

shadbell
12-18-2003, 10:26 AM
Thanks a lot! That is exactly what I was looking for. :D

Shad