ActiveX & Mappoint
ActiveX & Mappoint
Antonio,
How can I set these properties using ActiveX & FWH?
Using xHarbour I can using the following syntax:
oMapPoint:Toolbars:Item("Standard"):Visible := .T.
oMapPoint:Toolbars:Item("Navigation"):Visible := .T.
oMapPoint:Toolbars:Item("Drawing"):Visible := .T.
oMapPoint:Toolbars:Item("Location and Scale"):Visible := .T.
Using FWH I've tried a variety of options but cannot find the correct syntax to set these properties.
Thanks,
Randal Ferguson
How can I set these properties using ActiveX & FWH?
Using xHarbour I can using the following syntax:
oMapPoint:Toolbars:Item("Standard"):Visible := .T.
oMapPoint:Toolbars:Item("Navigation"):Visible := .T.
oMapPoint:Toolbars:Item("Drawing"):Visible := .T.
oMapPoint:Toolbars:Item("Location and Scale"):Visible := .T.
Using FWH I've tried a variety of options but cannot find the correct syntax to set these properties.
Thanks,
Randal Ferguson
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio,
Toolbars is a collection object. I don't know how OleGetProperty is suppose to work but I can do the following with the same results.
// This line turns on the Legend and works properly
oActiveX:SetProp("PaneState", 1) // Turn on legend for route planer
// This line returns nil
MsgInfo( OleGetProperty( oActiveX:hActiveX, "PaneState" ) )
// This line returns 1, which is correct.
MsgInfo( oActiveX:GetProp("PaneState") )
So, I don't know why using GetProp works and OleGetProperty does not.
Additionally, when I set the PaneState property the route planner legend is visible but does not respond to any mouse clicks. According to the Microsoft docs the legend and toolbars should respond to mouse clicks, i.e. there are no events to process through the event handler for the legend and toolbars.
Just like the Excel ActiveX displays a toolbar with default functionality, the MapPoint toolbars should behave the same way.
I purchased the FWH Apr 2006 upgrade so I could get the ActiveX functionality for this project. If I need to purchase a more recent upgrade or pay extra to get this working just let me know. This is a major project that a I must get working and I'm losing customers by not having this functionality.
Regards,
Randal Ferguson[/list][/quote]
Toolbars is a collection object. I don't know how OleGetProperty is suppose to work but I can do the following with the same results.
// This line turns on the Legend and works properly
oActiveX:SetProp("PaneState", 1) // Turn on legend for route planer
// This line returns nil
MsgInfo( OleGetProperty( oActiveX:hActiveX, "PaneState" ) )
// This line returns 1, which is correct.
MsgInfo( oActiveX:GetProp("PaneState") )
So, I don't know why using GetProp works and OleGetProperty does not.
Additionally, when I set the PaneState property the route planner legend is visible but does not respond to any mouse clicks. According to the Microsoft docs the legend and toolbars should respond to mouse clicks, i.e. there are no events to process through the event handler for the legend and toolbars.
Just like the Excel ActiveX displays a toolbar with default functionality, the MapPoint toolbars should behave the same way.
I purchased the FWH Apr 2006 upgrade so I could get the ActiveX functionality for this project. If I need to purchase a more recent upgrade or pay extra to get this working just let me know. This is a major project that a I must get working and I'm losing customers by not having this functionality.
Regards,
Randal Ferguson[/list][/quote]
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio,
With xHarbour I can set the properties to show the toolbars but they do not respond to any mouse clicks.
I've looked at samples for .net, vb, c#, c/c++ and I don't see anything extra you should have to do. You can see what events are available for Mappoint. There are no mappoint events to process in response to clicking on the toolbars.
I like the xHarbour implementation for accessing methods, properties, and objects. I don't have any problem accessing any of these using xHarbour.
I don't see anyway to access any of the many objects & collections available in MapPoint using FWH/ActiveX.
As to my original question, is there anyway to set the properties to show the toolbars?
Thanks,
Randal Ferguson
With xHarbour I can set the properties to show the toolbars but they do not respond to any mouse clicks.
I've looked at samples for .net, vb, c#, c/c++ and I don't see anything extra you should have to do. You can see what events are available for Mappoint. There are no mappoint events to process in response to clicking on the toolbars.
I like the xHarbour implementation for accessing methods, properties, and objects. I don't have any problem accessing any of these using xHarbour.
I don't see anyway to access any of the many objects & collections available in MapPoint using FWH/ActiveX.
As to my original question, is there anyway to set the properties to show the toolbars?
Thanks,
Randal Ferguson
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
My mistake. The right syntax is:Randal Ferguson wrote: oActiveX:SetProp("PaneState", 1) // Turn on legend for route planer
// This line returns nil
MsgInfo( OleGetProperty( oActiveX:hActiveX, "PaneState" ) )
// This line returns 1, which is correct.
MsgInfo( oActiveX:GetProp("PaneState") )
So, I don't know why using GetProp works and OleGetProperty does not.
ActXGetProperty( ActXPdisp( <oActiveX>:hActiveX ), cPropName )
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Randal,
A collection is a property that requires an extra parameter. This code is working right:
Now we just need to properly manage the clicks
A collection is a property that requires an extra parameter. This code is working right:
Code: Select all
...
local hToolBar, hStandard
...
oActiveX = TActiveX():New( oWnd, "MapPoint.Control.9" )
oWnd:oClient = oActiveX // To fill the entire window surface
oActiveX:Do( "Newmap", 1 )
oActiveX:SetProp( "PaneState", 1 )
hToolBar = oActiveX:GetProp( "Toolbars" )
hStandard = OleGetProperty( hToolBar, "Item", "Standard" )
OleSetProperty( hStandard, "Visible", .T. )
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Randal,
>
Clicking on the legend or any of the toolbar buttons does not trigger any event. The question now is why don't the toolbar buttons or legend respond to any mouse clicks?
>
Very good question We are asking the same, why ? We have turned VIRTUAL LButtonDown(), LButtonUp() methods, but the activex does not process the clicks. We keep searching...
>
Clicking on the legend or any of the toolbar buttons does not trigger any event. The question now is why don't the toolbar buttons or legend respond to any mouse clicks?
>
Very good question We are asking the same, why ? We have turned VIRTUAL LButtonDown(), LButtonUp() methods, but the activex does not process the clicks. We keep searching...
George,
No, I never got it to work. I had upgraded to FWH 2.7 Apr 2006 version to get the new ActiveX features but still could not get it to work. I don't know if a more recent version of FWH would make any difference.
I'm still very interested in making this work. If you'd like to compare notes please feel free to email me directly at scebee@yahoo.com. I'd be happy to share the code I have. I'd also be willing to pay someone to get this working.
Thanks,
Randal Ferguson
No, I never got it to work. I had upgraded to FWH 2.7 Apr 2006 version to get the new ActiveX features but still could not get it to work. I don't know if a more recent version of FWH would make any difference.
I'm still very interested in making this work. If you'd like to compare notes please feel free to email me directly at scebee@yahoo.com. I'd be happy to share the code I have. I'd also be willing to pay someone to get this working.
Thanks,
Randal Ferguson