Getting Started with the ActiveGanttVC Gantt Chart Scheduler Component

Saturday, September 24, 2011

ActiveGanttVC is an ActiveX Gantt Chart / Scheduler component designed for Visual C++, Visual Basic 6, Microsoft Access applications and practically any application that supports ActiveX controls. This is a complete tutorial that describes how to get started with the ActiveGanttVC Component. It covers installing the component, as well as creating very simple Visual C++, Visual Basic 6 and Microsoft Access applications with ActiveGanttVC.

The AGVC.ocx. ActiveGanttVC is statically linked to the MFC runtime files and as such does not require MFC runtime files.

Notes:

ActiveGanttVC can be used with any IDE capable of hosting ActiveX controls. But keep in mind that all of ActiveGanttVC's examples are in Visual C++ (Microsoft Foundation Classes), Visual Basic 6 and Microsoft Access (Visual Basic for Applications -VBA) and the component itself is programmed in Visual C++ and Microsoft Foundation Classes.

Select ActiveGanttVC from the drop down list and press the Download Now button, select the destination directory (this procedures varies according to the type of browser being used) and begin downloading.

The ActiveGanttVC install program is packaged in a compressed .zip file. The file names are structured according to the following convention:

Microsoft Foundation Classes versions are being released by Microsoft simultaneously with .NET framework versions, but ActiveGanttVC is unmanaged code and does not depend on the .NET framework.

Downloading will have left you with a file named AGVC_NETXX_X_X_X(D/R).zip.

The ActiveGanttVC install program does not contain any spyware, viruses or useless third party tools.

This .zip file contains two files: the .msi install package and a readme file in .rtf format. The readme file can be viewed using Microsoft Word or Word Pad.

Extract both files from the .zip file

Double click on the AGVC_NETXX_X_X_X(D/R).msi file to begin the install process. In Windows Vista and above you will get a security prompt. Click on the Run button to continue.

You will be taken to the welcome screen of the ActiveGanttVC installation program. Click on the Next button.

You will then be prompted for the installation directory. Click on the Next button.

The install program will ask for your confirmation before beginning to install ActiveGanttVC, click on the Next button.

Another security screen will ask you if you want the ActiveGanttVC install program to copy software onto your computer. Click on the Yes button.

After the ActiveGanttVC installation program finishes copying files to your computer, a browser window will open which contains all the above setup instructions plus any version specific information that might be of use.

Click on the Close button to terminate the installation of ActiveGanttVC.

The ActiveGanttVC component can now be uninstalled using the control panel. Always use the control panel application to uninstall ActiveGanttVC. After uninstalling the ActiveGanttVC component you can also erase the "C:\Program Files\Boötes Systems SAS\ActiveGanttVC\" directory for a complete uninstall.

You must completely uninstall the ActiveGanttVC component when upgrading to a more recent version or when switching from the Trial to the Release version.

On a default install of the ActiveGanttVC component, all files will be copied to the "C:\Program Files\Boötes Systems SAS\ActiveGanttVC\" directory.

The most important files in this directory are:

Path

File

Description

C:\Program Files\Boötes Systems SAS\ActiveGanttVC\

AGVC_TR.sln

The MFC C++ Visual Studio solution file.

C:\Program Files\Boötes Systems SAS\ActiveGanttVC\AGVCCON\Release

AGVCCON.exe

The MFC C++ executable file.

C:\Program Files\Boötes Systems SAS\ActiveGanttVC\AGVCCONVB6\

AGVCCONVB6.vbp

The example's VB6 project file

C:\Program Files\Boötes Systems SAS\ActiveGanttVC\ AGVCCONVB6\

AGVCCONVB6.exe

The example's VB6 executable file

C:\Program Files\Boötes Systems SAS\ActiveGanttVC\ AGVCCONACC2003\

AGVCCONACC2003.mdb

The AGVC Access 2003-2010 example

C:\Program Files\Boötes Systems SAS\ActiveGanttVC\AGVC\Release\

AGVC.ocx

The ActiveGanttVC ActiveX Control

C:\Program Files\Boötes Systems SAS\ActiveGanttVC\Additional Files\

AGVC.chm

The ActiveGanttVC compiled HTML Help file

The install program will generate four shortcuts on the desktop, the ActiveGanttVC folder is a shortcut to the Visual Basic 6 and Access example files, the Regsvr32UI.exe is a shortcut to a graphical Active-X install/uninstall tool (more information on the Regsvr32UI.exe tool can be found in this article), the ActiveGanttVC MFC Demo Project is a shortcut to the AGVC_TR.sln file and the ActiveGanttVC MFC Demo Executable is a shortcut to the AGVCCON.exe file.

The install program will also create an ActiveGanttVC menu in
Programs. This menu contains a shortcut to the folder were the AGVC.ocx file is stored, a shortcut to the ActiveGanttVC help file , a shortcut to the Regsvr32UI.exe utility, and shortcuts to the MFC C++, Visual Basic 6 and Microsoft Access 2003-2010 examples.

Additionally the ActiveGanttVC MFC Demo has three examples on how to read Microsoft Project 2003, 2007 and 2010 XML files.

All the code used to generate this demo is included in the AGVC_TR.sln Visual Studio Solution.

*Microsoft has not released and does not intend to release an ODBC driver for Access databases for x64 systems and therefore, the Access data source mode is not available when running the demo in 64 bit mode on a 64 bit system.

Additionally the ActiveGanttVC VB6 Demo has three examples on how to read Microsoft Project 2003, 2007 and 2010 XML files.

All the code used to generate this demo is included in the AGVCCONVB6.vbp Visual Basic project file.

*Microsoft has not released and does not intend to release an ODBC driver for Access databases for x64 systems and therefore, the Access data source mode is not available when running the demo in 64 bit mode on a 64 bit system.

The Microsoft Access demo shortcut is located in Desktop->ActiveGanttVC->Microsoft Access 2003-2010.

This demo is in Access 2003 format but can be upgraded to Access 2007 or 2010

Clicking on the ActiveGanttVC Access 2003-2010 Example shortcut will open Microsoft Access.

The ActiveGanttVC Access Example has two main examples:

The Work Breakdown Structure (WBS) Project Management Example which is explained here. This example demonstrates how to build a Gantt chart using ActiveGanttVC and Microsoft Access.

The Car Rental/Fleet Control Example which is explained here. This example demonstrates how to build a schedule or a roster using ActiveGanttVC and Microsoft Access.

Additionally the ActiveGanttVC Access Example has three examples on how to read Microsoft Project 2003, 2007 and 2010 XML files.

All the code used to generate this demo is included in the AGVCCONACC2003.mdb Access file.

*Microsoft has not released and does not intend to release an ODBC driver for Access databases for x64 systems and therefore, the Access data source mode is not available when running the demo in 64 bit mode on a 64 bit system.

In the New Project dialog select Installed Templates -> Visual C++ -> MFC Application. We will name the solution: MFCApplication1.

Clicking on the OK button will take you to the welcome screen of the MFC Application Wizard.

Click on the Next button. Change the Application Type to Dialog Based.

Click on the Finish button. The wizard will create a skeleton MFC application with one dialog: MFCApplication1Dlg and will redirect you to Resource View. Remove the "TODO" Static label and remove the OK and Cancel buttons and make the whole dialog bigger.

Right click on any empty spot inside the dialog and select Insert ActiveX Control from the drop down menu.

Important: Do not use the Add Member Variable Wizard as it will create unusable wrapper classes for the control. Adding a member variable for ActiveGanttVC must be done manually.

In a default installation the wrapper classes for the ActiveGanttVC Scheduler Component will be installed in the "C:\Program Files\The Source Code Store LLC\ActiveGanttVC\AGVCCON\AGVC_WRAPPERS\" folder. Wrappers come bundled in a single .h and .cpp file (ActiveGanttVCWrappers.h and ActiveGanttVCWrappers.cpp), or can also be included as separate individual files. The big advantage of using the bundled single file approach will be appreciated when having to upgrade to a newer version of the ActiveGanttVC Scheduler Component.

Copy ActiveGanttVCWrappers.h, ActiveGanttVCWrappers.cpp, MSP2003Wrappers.h, MSP2003Wrappers.cpp, MSP2007Wrappers.h, MSP2007Wrappers.cpp, MSP2010Wrappers.h and , MSP2010Wrappers.cpp from "C:\Program Files\The Source Code Store LLC\ActiveGanttVC\AGVCCON\AGVC_WRAPPERS\" to the MFC application's folder (in this case: "C:\Users\Admin7\Documents\Visual Studio 2010\Projects\MFCApplication1\MFCApplication1"). The wrappers must be on the same physical directory as the MFC project's stdafx.h file. MSP20XXWrappers are only necessary if you want to read Microsoft Project XML files.

Include the following lines at the end of your project's stdafx.h file:

The MFCApplication1Dlg.cpp contains implementation functions for CMFCApplication1Dlg and CAboutDlg. Make sure that you are adding the above code in the CMFCApplication1Dlg DoDataExchange function.

Press the F5 key to begin debugging.

At this time you will only have an ActiveGanttVC control with no functionality. The watermark on the lower right hand side will only be present in the trial version of the ActiveGanttVC Scheduler Component.

Close the dialog to exit debugging. Open MFCApplication1Dlg.cpp. In the MFCApplication1Dlg.cpp::OnInitDialog function under "// TODO: Add extra initialization here", add the following code:

The above code will create two Columns and ten empty Rows (Rows without any task objects). Notice that every Row has to be identified by a unique key: "K1", "K2", K3", etc. Press the F5 key to begin debugging.

All the Rows have been merged so that individual Cells are not visible.

The examples included in the MFC demo cover almost every piece of functionality present in the ActiveGanttVC component, but if you need further assistance please read our ActiveGantt support options. Important: if you are sending an e-mail you have to specify that you are referring to the ActiveGanttVC component, otherwise you will inevitably experience delays in having your query answered.

The IDE will create a project named Project1 with a single form called Form1. Resize Form1 to an appropriate size.

Go to Project -> Components. Once in the Components dialog box select ActiveGanttVC Scheduler Component and press the OK button.

The ActiveGanttVC Scheduler Component will now be present in the lower right hand side of the Toolbar.

Select the icon in the Toolbar and click and drag a rectangular area inside Form1. Resize as appropriate.

Press the F5 key to begin debugging. At this time you will only have an ActiveGanttVC control with no functionality. The watermark on the lower right hand side will only be present in the trial version of the ActiveGanttVC component.

Close Form1 to exit debugging.

Right click on Form1 and select View Code. Include the following code:

The above code will create two Columns and ten empty Rows (Rows without any task objects). Notice that every Row has to be identified by a unique key: "K1", "K2", K3", etc. Press the F5 key to begin debugging.

All the Rows have been merged so that individual Cells are not visible.

You can also change the add row line to:

ActiveGanttVCCtl1.Rows.Add "K" & i, "Row " & i, False, True, ""

To make Cells visible (if Cells are visible then the Row is split into columns).

You can now add Task objects by clicking and dragging over any Row in the Client Area of the ActiveGanttVC control.

The examples included in the VB6 demo cover almost every piece of functionality present in the ActiveGanttVC component, but if you need further assistance please read our ActiveGantt support options. Important: if you are sending an e-mail you have to specify that you are referring to the ActiveGanttVC component, otherwise you will inevitably experience delays in having your query answered.

Select the Enable all controls without restrictions and without prompting option and uncheck the Safe Mode check box.

Select the Create tab and click on Blank Form.

Right click on the Form1 tab and select Design View.

Form1 will now be ready to accept incoming ActiveX controls.

Click on the Design tab and on the lower right hand side click on the More button.

Select the ActiveX Controls option.

In the Insert Active Control dialog select ActiveGanttVC Scheduler Component.

Resize the ActiveGanttVC Component to an appropriate size.

Right click on the Form1 tab and select Form View.

At this time you will only have an ActiveGanttVC control on a Form with no functionality. The watermark on the lower right hand side will only be present in the trial version of the ActiveGanttVC component.

Switch back to Design View. Right click on the ActiveGanttVC control and select Propertries to bring up the properties window. Change the name from ActiveGantCtl0 to ActiveGanttCtl1A.

The ActiveGanttVCCtl1 function, allows the control to have intellisense in Visual Basic for Applications (VBA).

Close the VBA window, and switch to Form View. The above code will create two Columns and ten empty Rows (Rows without any task objects). Notice that every Row has to be identified by a unique key: "K1", "K2", K3", etc. All the Rows have been merged so that individual Cells are not visible.

You can also change the add row line to:

ActiveGanttVCCtl1.Rows.Add "K" & i, "Row " & i, False, True, ""

To make Cells visible (if Cells are visible then the Row is split into columns).

You can now add Task objects by clicking and dragging over any Row in the Client Area of the ActiveGanttVC control.

The examples included in the Access 2003-2010 demo cover almost every piece of functionality present in the ActiveGanttVC component, but if you need further assistance please read our ActiveGantt support options. Important: if you are sending an e-mail you have to specify that you are referring to the ActiveGanttVC component, otherwise you will inevitably experience delays in having your query answered.

All trademarks are property of their respective holders, and are only used to directly describe the products and services being provided. Their use in no way indicates any relationship or endorsement between The Source Code Store LLC and the holders of said trademarks.