Update and Release Notes
Update and Release Notes
Update and Release Notes
0
for Microsoft Visual FoxPro 6.0
32 bit Version for Windows NT, 95, 98
VFX 6.0 comes with no hardware copy protection. We decided to replace the HASP hardware
copy protection with a Registration Key and Activation Key software only based security system.
You can install VFX 6.0 and when you start the VFX builders, a dialog tells you your personal
Registration Key. All you have to do, is to register your copy online on our VFX Registration Web
and we will eMail your Activation Key which you can enter on your system. We deliver two
different types of Activation Keys: One which is limited to 30 days and another which is unlimited.
Note that you cannot copy the VFX installation from one PC to another without requesting a new
Activation Key. Your Registration Key is based on your PC and is unique. Every VFX user will
have a distinct unique Registration Key and therefore needs to register online on our web to get the
Activation Key in order to be able to work with the VFX Builders. The only way to get an
Activation Key is by registering on our registration site on the web
http://www.devigus.com/vfxreg/
We are convinced that in todays world where things change dramatically fast, the shortened
payback time of a mayor investment like VFX has been for us, the investment of both, our
customers and our own has to be protected the best possible.
We hope that you appreciate the new Software based approach and welcome you to the next
generation of VFX. The very best VFX ever!
0. Start the VFP Options Dialog with the menu Tools/ Options.
1. Set the Builders: point to the VFX Builder Application named VFXBLDR.APP, which you
will find in the \VFX60\BUILDER Directory.
2. Set the Default Directory: \VFX60 (or any directory containing a VFX60 project),
3. Set the Search Path: add \VFX60\BUILDER to the search path,
Next, you may want to make sure that the VFX6.0 menu pad automatically appears whenever you
start your Visual FoxPro 6.0. We suggest the following procedure to do so:
Add this line into your CONFIG.FPW file located in your VFP6 directory:
NOTE: If you dont have a file named config.fpw just create one with notepad.
command=do(HOME()+"vfp.prg")
This line tells VFP to start the progam file vfp.prg when starting. In VFP.PRG (create this prg also
with notepad and place it also in the VFP directory) make sure to add these lines:
DOVFXMNU
If you use also xCase, add the following line at the end of your start program described above:
SET SYSMENU SAVE
DO c:\xcase\vfp5\foxcase.app
Create a new project using the new VFX 6.0 application wizard. Select the option Application
Wizard from within the VFX 6.0 menu. In the VFX 6.0 Application Wizard you can select the
name of the database right at the beginning. If the database in your VFX 5.0 project was named
mydata.dbc make sure to generate the new project with the same database name "mydata.dbc".
This eliminates the need to update the database settings later in your application.
What to do with your existing DATA:Since the VFX 6.0 Applications have right after the
generation an empty DBC, you can copy all of your application data into the \Data directory! First
free your VFX Tables from your current DBC and then copy the VFX-free DBC to the new project
where you can add the VFX tables into the DBC if you want to. Because some of the free tables of
VFX are having a new structure due to enhancements dontt copy the tables VFX*.DBF. Use
APPEND FROM to get the data from the old VFX*.DBF tables into your new VFX 6 project if
you need that.
The idea behind this single click user interface is simple: The user must be enabled to call whatever
function he wants by just moving the mouse over the desktop and singleclicking when he wants to
activate the selected item.
If you want to upgrade your existing application to this new look and feel, you can create a class
which is based on the class CNavCont in your APPL class library (or any other class library file).
Then, just add the objects you want to offer on your desktop by putting them on the appropriate
pages. Your own active desktop class could look like this:
LOCAL lcerror
lcerror=ON("ERROR")
ON ERROR *
PUBLIC goagent
goagent=CREATEOBJECT("cagent")
ON ERROR &lcerror
IF VARTYPE(goagent)="O"
goagent.welcome()
ENDIF
ENDIF
ENDPROC
The above DrawBackground() method is used to set the background and to set all the related
graphical components which are used to define the desktop how you like it.
Sample: See the class activedesktop in the class library file APPL.VCX as well as the associated
code in VFXMAIN.PRG as described above.
You find a new class named CRepGen in the class library file VFXREP.VCX which offers
automatic reports on demand.
Start the VFXTEST application and open the parent form. When you select the preview button in
the form toolbar, you will receive the following:
On page one, named options, you can define two lines for a title of the report, in the Print options
you can define Preview or Print (preselected depending on how this form has been called), the
format (portrait or landscape), whether you want to have page numbers, whether the page number
should be suppressed on the first page and whether you want to have a date and time printed on the
report header.
This cool feature is automatically available in all of your forms if you don't have code in your
onprint method and if VFX cannot find a report with the name of the active form!
To make it easy for the developer to use this form class, we already created a form named
VFXREPGN.SCX/SCT based on the class CRepGen. This form can be modified directly using the
form designer to make application specific modifications.
NOTE: The reports are created based on template files specified in the properties
cRepNamePortrait and cRepNameLandscape. The defaults for these properties are:
report\rtmpport resp. report\rtmpland. The report files rtmpport.frx/frt resp. rtmpland.frx/frt must
exist in the actual report directory of the application.
However, sometimes you have more than one specific, predefined report you want to make
available to the users of your application in the context of a specific data manipulation form. This
is where the new Report Selection class comes in very handy:
Layout:
Fields:
Reporttypeid Internnal ID
Filename Name of the reports of this type. Do not use more than 5
characters. This Filename is used as the prefix for the created
reports of this type. The final report name will be the prefix plus 3
generated numbering characters.
Descr Description of this report type
Sort Value to sort in the List
Properties:
cReportTypeList Defines, which report types are used in the crselection based form.
ATTENTION: Enter exactly in the following format since its used
in the program directly: ='1,2'
nReportID Used to save and default the actually selected report. Used
internally.
nReportType Used to save and default the actually selected report type. Used
internally.
Methods:
OnPrePrintReport() This method is called from the crselection dialog based forms to
preview/print the selected report. Called before the OnPrintReport.
Place your code in this method to establish data environment or
select statements.
OnPrintReport() This method is called from the crselection dialog based forms to
preview/print the selected report.
OnPrePrintReport() This method is called from the crselection dialog based forms to
preview/print the selected report. Called after the OnPrintReport.
Place your code in this method to cleanup.
CRSelection Dialog:
In the Editbox below the list, a meaningful description can be edited and will be displayed when
the corresponding report has been selected in the above list.
Commandbutton: Print
Prints the selected report if the checkbox "To Ascii" has not been selected. If the checkbox "To
Ascii" has been selected, the report will be expported into an ASCII file.
Commandbutton: Preview
Previews the selected report if the checkbox "To Ascii" has not been selected. If the checkbox "To
Ascii" has been selected, the report will be expported into an ASCII file.
Commandbutton: Modify
Calls the "modify report" command. The report environment will be prepared.
Commandbutton: Copy
Copies the selected report and flags it for the current user which can modify it as needed.
Commandbutton: Delete
Deletes the currently selected report.
Checkbox: To Ascii
The report will be exported as an ASCII file.
Checkbox: Template
Defines whether this report is a template or not. This is an administrator option.
Commandbutton: Export
Exports a report into a to be specified directory.
Commandbutton: Import
Imports one or more reports from a to be specified directory.
Sample in VFX6TEST:
In the VFX6TEST application you find a sample of the usage in the form "reports.scx". You find
this form on the active desktop on the page "more" at the bottom with the label "Report Selection".
On the fom, only the property cReportTypeList has been set, that's all.
To call the report selection dialog, in the above example, the following code has been added to the
click event of the "Form.CNTSPEEDBAR.cmdreports" command button with the caption
"Reports...".
loDialog.show()
endif
release lodialog
whereas the class CRSelection receives the two properties "thisform" and "thisform.creporttypelist"
as parameters.
Strategy 2: Separate only the application data, keep one set of VFX Tables
This strategy separates only the application core data, not the VFX tables. This has the advantage,
that all data work with the same application settings as defined in the commonly used VFX tables.
Especially the logon authentication, using the VFXUSR table, will have to be maintained only
once.
The definition of the strategy will be made in the VFXPATH.DBF. This is a new table which must
be located in the directory from where the application starts.
Sample: In the VFXTEST Application, you can copy the data directory and create a data2
directory and make the following entries in record 1 of the VFXPATH table:
Field Value
CLIENTNAME Standard
DATAPATH data\
UPDATEPATH update\
REPORTPATH reports\
VFXPATH data\
Field Value
CLIENTNAME Alternate
DATAPATH data2\
UPDATEPATH update\
REPORTPATH reports\
VFXPATH data2\
When an application with multiple data sets starts and the application class property
goProgram.cDatadir is empty, VFX offers a selection screen where the user can select the data set
with which he wants to work:
In VFX 6.0 we deliver a feature a lot of customers requested: The multi site feature where a client
can have multiple data directories each one with different data sets as described above.
If you have multiple data directories you don't want to update all the data structures of these data
directories manually one by one. Rather you would like to update all of them in one by providing
just in one update directory the new database files. Based on the VFXPATH setting, VFX will
automatically update all data directories with the new structure.
Sample: Make sure to check out the VFXTEST application for a demo of this exciting new
feature!
New Audit Trail feature for detailed field level change tracking
The long desired audit trail feature has been integrated in this version of VFX. We developed an
inhouse version of this audit trail feature a year ago and could test this feature extensively. The
usage is very simple. All you have to do to enable auditing of changes in any table is to add the
triggers in the database like this in the Insert, Update and Delete trigger.
endfunc
function _audit_update()
if type("pldoaudit")<>"U" and !pldoaudit
endfunc
function _audit_delete()
endfunc
function _ToChar(tuParam)
return lcRetVal
endfunc
function getwinuser
return alltrim(lcUserId)
function getpknum()
return lnretval
This VFX based audit trail feature is very handy and there are only a few things you must verify
for a succesfull use of this feature:
NOTE: If your table is not buffered, you will not see changes from to .. Since the buffering
is needed in order to differentiate oldval from the buffered (i.e. replaced) value.
Very important: You must be very carefull when working with local views: Local views open the
base tables in a non buffered mode (this is a VFP behaviour and in the case of remote views you
don't have this problem by design). In order to see correct audit trail entries in the case you work
with local views, you must make sure that the base tables are opened with buffering enabled. Very
important in this context: A Tableupdate() from your views would then only update the buffered
table, not the physical table, since the base table is buffered! Thats why you must use a
Tableupdate() to update the change in the base table on disk!!! Very tricky. Be careful!
SAMPLES: In VFXTEST you find the audit trail feature enabled for the table parent.dbf. In the
form audit.scx you see a sample how to present the changes applied to a table. You could of course
also use any other method to present the changes to your users, this is just a possible way to do it.
This new class is very useful if you want to use the new Microsoft ActiveX
Agents. A new way of interaction with the users of your application. Microsoft
Agent is a set of software services that supports the presentation of software
agents as interactive personalities within the Microsoft Windows interface. The
conversational interface approach facilitated by the Microsoft Agent services is
an extension and enhancement of the existing interactive modalities of the
Windows interface.
I am Merlin!
Microsoft created three different characters. One of them, named Merlin (see above picture), comes
even with speech functionality, thats why we wrote a wrapper class to support easy usage of this
exciting new ActiveX Control.
Use this class if you want to talk to your users in a different way rather than using messageboxes
and wait windows!
SAMPLE: You can see the usage of the agent class in the VFXTEST application. In the
VFXMAIN.PRG you see the instantiation of the agent control in the drawbackground method:
LOCAL lcError
lcError=ON("ERROR")
ON ERROR *
PUBLIC goagent
IF FILE("C:\Programme\Microsoft Agent\Agentsvr.exe") OR;
FILE("C:\Program Files\Microsoft Agent\Agentsvr.exe")
goagent=CREATEOBJECT("cagent")
ON ERROR &lcError
if vartype(goagent)="O"
goagent.welcome()
The object reference goagent is created as a public variable goagent and can easily be used to
interact with the interface of the cagent class.
In the form merlin.scx (in VFXTEST application), you find samples for all the Merlin features we
made available through the cagent class:
After successful installation of the Agent Control, you will see the following Icon (man with hat) in
your status bar: indicating that the agent is running. In order to be able to use the
merlin character in your applications you need to have the file merlinsfx.acs in the \Program
Files\Microsoft Agent\ directory, that's all. The characters can be downloaded from the Microsoft
Web at:
http://www.microsoft.com/workshop/c-frame.htm#/workshop/imedia/agent/default.asp
NOTE: If you leave this property empty, the form will not
participate as a favorite candidate, the Favorites menu will be
disabled.
cFavoriteMenu Name of the menu entry created for this form as the user sees it in
the Favorites menu. If you leave this menu name empty, the above
scx name will be taken. Probably you want to define a friendly but
not too long menu entry name here.
Sample: In the VFXTEST application you can open the parent form, position on a specific record
and select Add to Favorites in the Favorites menu. Now you should see the selected record in the
newly added menu option called parent similar to this:
By simply clicking on the item in the menu, the form Parent opens (only if not yet open) and
positions on the desired record. If the form is already open, this open instance is used unless the
user has uncommited changes open.
The new feature is available in the edit menu as seen above named Copy Record. Also in the main
toolbar, a new command button has been inserted just next to the New button:
If you use the CSpeedbar class in the forms, you will like that now all the command buttons use
proper tooltiptext and of course the new Copy Record button exists there as well:
We implemented this copy feature exactly the same way we implemented the New, Edit, Delete and
all the other CDataForm based data manipulation features. The new methods used for the copy
process are:
Event Called by
onprecopy oncopy
oncopy User
onpostcopy oncopy
NOTE: Since Primary keys and Candidate keys should not be copied (Error 1884, you might
know this one) VFX detects them and does clear the corresponding fields automatically! Thats
cool and very, very useful. Thats why this copy record feature is a no brainer, just use it with no
risk at all. Thats productive!
Sample: Have a look at the VFXTEST Application. All forms have this feature implemented since
its now a VFX 6.0 native feature! Play around with it and note that Primary and Candidate keys
are automatically detected and NOT copied!
The content of this form is based on the VFXFOPEN table, the table which is responsible to store
all forms available in an application.
The idea is simple, if you look at the form you might guess it already: Based on the Level the user
has, he can perform the View, Insert, Edit or Delete action on the form. In the above example, the
userlevel must be 1 to be able to view the parent table, 2 to view, insert edit and delete the Child
table and 3 to view, insert, edit and delete the Item table.
VFX automatically manages the whole process of hiding a form in the open dialog when a user has
no view access as well as the setting of the lCanEdit, lCanInsert and lCanDelete properties
available on the data manipulation class.
Samples: Have a look at the VFXTEST Application and play around with this security feature to
see how easy it is to add security enhancements to your own applications without a single line of
coding.
To overcome these limitations, and to offer the users a better, more transparent selection
mechanism, we developed a class which allows easy usage of multiple views in just one single
Client/Server form. Sounds to good to be true? No, look here, its really straight foreward:
Sample: Before exploring the usage of this class, lets have a look at a sample of a query form
with multiple different views in action: When the user calls a data manipulation form which calls a
queryform from its init method (do form queryform with this, we will see this later), the user sees
the queryform appear before the main data manipulation form is actually visible (it exists already
but is just not yet visible):
When the user selects a different search by criteria in the combobox, he receives the following
display (sample):
After reapplying the new selection, other data will be displayed using the data manipulation form
we saw just before.
Create the data manipulation form based on CDataFormPage or any other class
NOTE: In the data environment you add just one view, not all of them! Adding all of them would
slow down your form load since all table information would then have to be retrieved via ODBC
from the server which can take some seconds if you have multiple views. Note that VFX switches
the views automatically at runtime as we will see later. You must just add one view to the data
environment thats all.
Set the pagecount property to the number of different selections you want to
have
On the pageframe you define how many different selections you want to define.
Every selection corresponds to a page on the pageframe on the query form. The relation between
view and page is automatically done through the caption of the page. This has the advantage, that
the order can anytime be rearranged by just changing the order in the FillViewNames() method
shown above. There is never the need to change the physical order of the pages within the
pageframe. Cool, isnt it?
Define the cViewParameter property on every control you use to enter the
selection criterias
On every page of your pageframe, you have one or more selection criterias. Now you might ask:
How does VFX bring the entered selection criterias to the selection parameters defined in the
views?. Thats easy: Just use the property cViewParameter on the different controls you used to
let the user enter the selection values. VFX then automatically sets the control source of the
controls to this (public) variable which will then be used during the requery of the view. All VFX
controls have such a property cViewParameter.
Relate the Query form with your main data manipulation form
At the end of the init() method of your main form just add one line of code:
do form myqueryform with this
Thats all. And in the click event of the requery button add:
do form myqueryform with thisform
Note that you have to write thisform, since this would mean the command button. If you want to
make things perfect, you could add the following line of code in the refresh() event of the Requery
button as well:
this.enabled = thisform.nformstatus = 0
Which is a nice oneliner to define that the button should be disabled when in edit or insert mode.
Similar code can be used at several occasions btw.
Who said Client/Server development has to be difficult? Not if you have VFX 6.0!
The classes Word and Excel existed already in a preliminar release in VFX 5.0. They have been
enhanced. Completely new is the class Outlook, which revolutionizes the way you interact with
Outlook 97 and 98.
Sample: Make sure to download the Outlook Sample Project from our VFX 6.0 site.
Sample: The usage is demonstrated in the VFXTEST application on the form parent. In the click
event of the command button with the caption Gauge with time! you see the following code to
illustrade the usage of the VFXMTR form which uses the new gauge class:
* Test for Meterdialog using the vfxmtr form
set cursor off
do form form\vfxmtr name xy
xy.cntmeter.setmaxvalue(50)
if vartype(xy)="O"
xy.release
endif
set cursor on
When the user clicks the command button or presses F9, the date selector dialog appears.
<Pickdate dialog>
SAMPLE: You can see a sample of this class in the VFXTEST application in the form parent.scx.
NOTE: The successful usage of this class depends on proper installation of the Microsoft
Calendar ActiveX Control MSCAL.OCX.
FUNCTION askform
*-------------------------------------------------------
* Parameters..:
* Messagetext,
* numeric value like for messagebox,
* caption of the dialog,
* caption of button 1,
* caption of button 2,
* caption of button 3,
* use the timeout,
* timeout value in seconds
* Returns: 1, 2 or 3 depending which command butten has been clicked
*-------------------------------------------------------
LPARAMETERS tctext, tnvalue, tctitle, tcbuttontext1, tcbuttontext2,
tcbuttontext3, tltimer, tntimeout
LOCAL lnreturn
IF VARTYPE(goprogram)="O"
DO FORM vfxaskfm WITH tctext, tnvalue, tctitle, tcbuttontext1,
tcbuttontext2,;
tcbuttontext3, tltimer, tntimeout TO lnreturn
ELSE
DO FORM FORM\vfxaskfm WITH tctext, tnvalue, tctitle, tcbuttontext1,
tcbuttontext2,;
tcbuttontext3, tltimer, tntimeout TO lnreturn
ENDIF
The form VFXASKFORM.SCX is based on the class CAskForm which is located in the VFXCTRL
class library file.
SAMPLES: In the VFXTEST application on form parent.scx. See the button with the caption
Askform.
SAMPLE: In the VFXTEST application you find the call of this method in the main toolbar in the
class library file APPL.VCX the class CAppToolbar on the button left to the relogon button.
NOTE: This class uses word to print the print screen to the printer.
The source code in the RightClick menu of the VFX base classes ctextbox, ceditbox, ccombobox
and cpickfield looks like this:
DEFINE POPUP shortcut shortcut RELATIVE FROM MROW(),MCOL()
DEFINE BAR _MED_CUT OF shortcut PROMPT ttt_cmdcut
DEFINE BAR _MED_COPY OF shortcut PROMPT ttt_cmdcopy
DEFINE BAR _MED_PASTE OF shortcut PROMPT ttt_cmdpaste
IF pemstatus(THISFORM,"lUseHook",5)
IF THISFORM.lusehook
THISFORM.oneventhook("RightClick",THIS,THISFORM)
ENDIF
ENDIF
ACTIVATE POPUP shortcut
The hook provides an easy way to expand all the right click menus with just some lines of code in
the VFXHOOK.PRG file.
In the ccombobox we added a requery option. This gives the users of your application an easy way
to requery a combobox by just using the requery option in the rightclick menu of the combobox.
Sample: In the VFXTEST Application you can test this class by clicking on
http://www.devigus.com in the class activedesktop in APPL.VCX.
The class is located in the class library file VFXAPPL.VCX. The nice thing about this class is
especially the visualization of the current form status.
when in edit mode, the CTitleinfo object automatically switches to this display:
All this with just one line of code in the refresh of the page or wherever you need to refresh the
content when a record moves or so:
This.Ctitleinfo1.settitle(alltrim(str(parent.parentid, 10)) + ", " + trim(parent.descr))
The method settitle can be used to set the title to whatever string expression you need.
Sample: In the VFXTEST application the form parent2.scx (see refresh code of page2).
Now, you can achieve exactly this behaviour by setting the property lAutologin of the application
class CFoxApp in the VFXMAIN.PRG to .t.:
Sample: See VFXTEST application, VFXMAIN.PRG, look for lautologin, remark the remarks
and set to .t.!
For those VFX users who have not yet used this class in a Client/Server environment, we
encourage you to have a look at the VFXTECH.HLP help file and look for the CPickfield class and
especially the nValidmode property.
SAMPLES: In the VFXTEST application you find plenty of samples of the CPickfield class. If
you are a Client/Server developer, you will find it especially usefull to look at the xvchild form.
The two pickfields cntParentID and cntItemID show how to operate in a Client/Server environment
where user input validation is done by retrieving exactly one record and not all the rows using a
separate view from the normal picklist view.
Now, the code has been enhanced in order to assure that also when the explicit century has not been
set the default century will always be the actual century:
if type("goProgram")=="O"
lcDateFormat = iif( empty(goProgram.cDateFormat),"BRITISH",goProgram.cDateFormat)
lCentury = goProgram.lCentury
else
lcDateFormat = set('DATE')
lCentury = .t.
endif
if lCentury
set century on
else
set century off
endif
Additional Y2K Infos: See also the Application class properties nCentury and nRollover as well
as the VFP SET CENTURY command. Additional Y2K Info you find also on:
http://www.microsoft.com/technet/topics/year2k/default.htm
To make it easier to integrate VFX 6.0 in the component gallery, we wrote a wizard which adds the
VFX classes to the component gallery of VFP. Just call the Component Gallery Installation Wizard
you find in the VFX 6.0 menu: