FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ActiveX & Mappoint
Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
ActiveX & Mappoint
Posted: Mon Jun 12, 2006 01:27 PM

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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
ActiveX & Mappoint
Posted: Mon Jun 12, 2006 02:10 PM

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
Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
ActiveX & Mappoint
Posted: Mon Jun 12, 2006 04:14 PM

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]

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
ActiveX & Mappoint
Posted: Mon Jun 12, 2006 09:22 PM

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
Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
ActiveX & Mappoint
Posted: Mon Jun 12, 2006 10:28 PM

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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
ActiveX & Mappoint
Posted: Tue Jun 13, 2006 06:44 AM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
ActiveX &amp; Mappoint
Posted: Tue Jun 13, 2006 07:41 AM
Randal,

A collection is a property that requires an extra parameter. This code is working right:
   ...
   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 :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
ActiveX &amp; Mappoint
Posted: Tue Jun 13, 2006 01:38 PM

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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
ActiveX &amp; Mappoint
Posted: Tue Jun 13, 2006 03:29 PM

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
Posts: 729
Joined: Tue Oct 18, 2005 06:49 PM
ActiveX &amp; Mappoint
Posted: Tue Apr 17, 2007 11:25 PM

Randal,

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

Regards

George

Posts: 284
Joined: Mon Oct 24, 2005 08:04 PM
ActiveX &amp; Mappoint
Posted: Tue Apr 24, 2007 02:52 PM

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

Continue the discussion