Xbase++
Exontrol.COM Software - Frequently Asked Questions
XBA.0:
In Xbase++ 32-bit you can use any of the following versions:
  • /COM indicates the 32-bit edition of the ActiveX version

The application built using /COM version runs on any Windows 32 or 64-bit machine.

In Xbase++ 64-bit you can use any of the following versions:

  • /COM/64 indicates the 64-bit edition of the ActiveX version

The application built using /COM/64 version runs on Windows 64-bit machine only. The application built using /COM/64 version cannot run on Windows 32-bit machine.

If you want to use your application on 32 and 64-bit machines, you can go for:

  • /COM/ANY indicates the 32 and 64-bit editions of the ActiveX versions

Should I use a 32-bit or 64-bit version of the control?

XBA.1:
The Xbase++ provides methods like setProperty / getProperty to set or get a value for a specified COM property. :setProperty() is used to set a value of a property exposed by a COM/ActiveX component. Calling :setProperty() is required when accessing a property of a COM/ActiveX component that has the same name as an instance variable of the AutomationObject. Using :setProperty() is also required to when more than one value must be passed to the property of the connected COM/ActiveX component (multiple parameters).
oChart:SetProperty("PaneWidth",.F.,96)

instead of:

oChart:PaneWidth(.F.) := 96
XBA.2:
The Xbase++'s GraMakeRGBColor method calculates a RGB color value from color intensities of red, green and blue, that's not compatible with /COM objects, using the OLE automation. You need to use the AutomationTranslateColor function to convert the Xbase++'s color to an OLE color like in the following sample:
AutomationTranslateColor( GraMakeRGBColor({255,0,0}), .F. )

instead of:

GraMakeRGBColor({255,0,0})

so changing the color of the Task bar can be defined such as:

oG2antt:Chart():Bars():Item("Task"):Color = AutomationTranslateColor( GraMakeRGBColor({255,0,0}), .F. )

instead of:

 oG2antt:Chart():Bars():Item("Task"):Color = GraMakeRGBColor({255,0,0})
XBA.3:
The control's BackColor/ForeColor properties ( OLE_COLOR properties ) requires calling the SetProperty method, if using AutomationTranslateColor method as in the following samples:
oG2antt:BackColor := GraMakeRGBColor({255,0,0})

or

oG2antt:SetProperty("BackColor", AutomationTranslateColor( GraMakeRGBColor({255,0,0}), .F. ))

instead of:

oG2antt:BackColor := AutomationTranslateColor( GraMakeRGBColor({255,0,0}), .F. )

or:

oG2antt:BackColor := GraMakeRGBColor({255,0,0})

In conclusion, properties of Color type that belongs to the main object can be set using the GraMakeRGBColor({aRGB}) without AutomationTranslateColor method, and the AutomationTranslateColor(GraMakeRGBColor({aRGB})) for any other property of Color type that belongs to inside objects like in the following samples:

oG2antt:BackColor := GraMakeRGBColor({255,0,0})

or

oG2antt:Chart():BackColor := AutomationTranslateColor(GraMakeRGBColor({255,0,0}),.F.)
XBA.4:
The Xbase++ provides the XbpFont class that can be used by control's Font properties like: ItemFont, CellFont,, ... and so on like in the following samples:
oFont := XbpFont():new():create( "12.Arial.Bold" )
oItems:SetProperty("ItemFont",h,oFont)
oFont:destroy()

Also the controls support built-in HTML format which implements the <font> HTML tag that can be used to change the font for a part of the caption like in the following sample:

oItems:SetProperty("CellValue", h, 0, "<font Arial;12>Item</font>Font")
oItems:SetProperty("CellValueFormat", h, 0, 1 /*exHTML*/)
 
XBA.5:
Usually, this exception is fired once a native method of Xbase++ is called as a member of a COM object. For instance, the Copy method of the Bar object, copies the bar to a new bar, while the Copy method of the Xbase++ copies the selection to a clipboard. You need to use the callMethod method of Xbase++, to prevent the confusion, like in the following sample:
oBars:CallMethod("Copy","Task","STask"):Color := 0xff

instead of:

oBars:Copy("Task","STask"):Color := 0xff
XBA.6:
The exception is fired if the passed object to the PrintExt / PrintExts property of the Exontrol.Print component can be used to provide Print and Print Preview.
oG2antt:Template := "Dim p;p = CreateObject(`Exontrol.Print`);p.PrintExt = Me;p.AutoRelease = False;p.Preview();"

instead of:

oPrint := CreateObject("Exontrol.Print")
oPrint:PrintExt := oG2antt
oPrint:Preview()

Here's a sample that changes also the captions in the print and print preview framework

Template := "dim p;p=CreateObject(`Exontrol.Print`);"+;
"p.AutoRelease=True;"+;
"p.Caption=`Your Company Logo`;"+;
"p.ItemCaption(3)=`Auf Seitenbreite zoomen`;"+;
"p.ItemToolTip(4)=`Ganze Seite zoomen`;"+;
"p.ItemToolTip(5)=`Zwei Seiten zoomen`;"+;
"p.ItemCaption(101)=`<img>2</img>Eine Seite`;"+;
"p.ItemToolTip(101)=`<img>2</img>Eine Seite`;"+;
"p.ItemCaption(102)=`<img>3</img>Mehrere Seiten`;"+;
"p.ItemToolTip(102)=`<img>3</img>2 oder mehr Seiten`;"+;
"p.ItemCaption(103)=`<img>4</img>Einstellung`;"+;
"p.ItemToolTip(103)=`<img>4</img>Seite einrichten und Drucker w�hlen`;"+;
"p.ItemCaption(104)=`<img>5</img>Drucken`;"+;
"p.ItemToolTip(104)=`<img>5</img>Dokument drucken`;"+;
"p.ItemCaption(105)=`<img>6</img>Beenden`;"+;
"p.ItemToolTip(105)=`<img>6</img>Druckvorschau beenden`;"+;
"p.PageOrientation = 2;"+;
"p.Options=`FitToPage=On`;"+;
"p.PrintExt=Me;p.Preview()"
  
oDlg:oG2antt:ExecuteTemplate(Template)
You can find more about Print and Print Preview on Get Started page.
XBA.7:
The XBase++ requires to specify the value for License field using the control's runtime license key. The runtime license string is provided by us free of charge, at your request, while your maintenance or subscription is active ( NOT expired ). Your development license key is NOT the control's runtime license key. 

Here's a short sample where runtime-license key should go:

::oG2antt := xbpActiveXControl():new( ::drawingArea ,,{0,0}, {976,608})
   ::oG2antt:CLSID := "Exontrol.G2antt"
   ::oG2antt:license := "xxxxxxxxxx"

 where is "xxxxxxxxxx" is the control's runtime license key. Once again, the runtime license string is provided by us free of charge, at your request, while your maintenance or subscription is active ( NOT expired ). Your development license key is NOT the control's runtime license key.