ActiveX & Mappoint

Post Reply
Randal
Posts: 250
Joined: Mon Oct 24, 2005 8:04 pm

ActiveX & Mappoint

Post by Randal »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Randal,

This should be the first step:
MsgInfo( OleGetProperty( oActiveX:hActiveX, "Toolbars" ) )

but it is returning a nil value.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Randal
Posts: 250
Joined: Mon Oct 24, 2005 8:04 pm

Post by Randal »

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]
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Randal,

The current ActiveX support is the same, so there is no need for the upgrade.

It looks as the MapPoint ActiveX implementation is not the standard one, or at least it is not done in the way that we use it from FWH.

Can you get the right behavior and events with xHB ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
Randal
Posts: 250
Joined: Mon Oct 24, 2005 8:04 pm

Post by Randal »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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.
My mistake. The right syntax is:
ActXGetProperty( ActXPdisp( <oActiveX>:hActiveX ), cPropName )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Randal,

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. )
Now we just need to properly manage the clicks :)

Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
Randal
Posts: 250
Joined: Mon Oct 24, 2005 8:04 pm

Post by Randal »

Antonio,

Thanks, this works great to turn on the different toolbars.

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?

Thanks,
Randal Ferguson
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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...
regards, saludos

Antonio Linares
www.fivetechsoft.com
George
Posts: 710
Joined: Tue Oct 18, 2005 6:49 pm

Post by George »

Randal,

Did you get to work with MapPoint ?
Can you shared with us some code samples?

Regards


George
Randal
Posts: 250
Joined: Mon Oct 24, 2005 8:04 pm

Post by Randal »

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
Post Reply