cmVodbx32 Bars Graph Editor ( version 5.x.x )

ClassMate 209 Free Package



Introduction

This Dll Bar Graphic Editor has been made with CAVO 28 and ClassMate 209. It uses the Pinnacle-BPS ActiveX Graph Control "OCX" originally made by "Bits Per Second Ltd". But this company does not seem to exist anymore.

This package contains source code for the interface between ClassMate 209 and the "OCX". It cannot be used from prior version of CAVO 2.8 ( It has not been tested on CAVO 2.8. It can be converted to pure CAVO code, but I think it will be an hard work to convert Dialog and Menus.

This package is free ( source and Dll ) . You can include it in your own programs, but it is at your own risk. The author does not give any guaranties nor assume any responsibilities. Go top


List of files

Files: Description:
Graph32.ocx Pinnacle-BPS ActiveX Graph Control
gsw32.exe Graphics Server
gswdll32.dll Graphics Server DLL
cmVodbx32Graphic.DLL The Graphic Dll interface with ClassMate 
cmVodbx32Graphic.AEF Source code for the interface
cmVodbx32Graphic - DLL.AEF Prototypes if you want to link into your program
CavoMenuTB.bmp CAVO Tool bar menu used in CAVO IDE MENU to generate programs
fruit.dbf Test file

Go top


Licence Limitations

Graph32.ocx is a very old control, it was part Visual Basic V4.0, and if understand well the Graph32.ocx control was used in VB4 and replaced with MSChart.OCX in VB5. 

It's seems this control has been discontinued, however it still to work well  for the limited graphic used with the program here.

List of Visual Basic version 4.0 Custom Controls Discontinued in Visual Basic, version 5.0 at:
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q172193

Microsoft may still have legal rights on this "OCX" ( even if it is discontinued ), therefore be sure to not violate any laws if you decide to incorporate it into your programs. This is why this package is free, including the source code for the interface. If you own VB4 and later versions, I am pretty sure you have the right for distribution.

The author does not give any guaranties nor assume any responsibilities. Go top


Installation

1) Copy Graph32.ocx, gsw32.exe, gswdll32.dll into your windows system(win98), sytem32(NT+) directory. Warning: This is at your risks, if files already exist, make a backup of them in case of incompatibilities. 

2) Copy the cmVodbx32Graphic.DLL into the your cmVodbx32-V4 directory ( Should be c.\Program Files\cmVodbx32-V4 )

3) Copy the fruit.dbf file into a temporary directory, for testing

4) Open the main program [ cmVodbx32.exe ] and click on the toolbar graph icon. ( note: the program will register the OCX when the Dll is called )

Your Done. Go top


Examples of  DLL utilisation

Example1 of  DLL utilisation ( External Call )

1) Set Global variable ptrGraphLibrary as PTR

2) Make the method call

METHOD Menu_CallGraph CLASS FullTabs  //may be another class

LOCAL oB AS cDatabrowser, liError AS LONG
LOCAL oServer AS cDbServer
LOCAL pEntry AS PTR
LOCAL cFile AS STRING

oB:=SELF:Browser //get the browser
oServer:=oB:Server //get the db server from the browser
/*
LONGINT , the return value from the function CallGrah( oWin as cWindow, oServer as cDbServer ) AS LONGINT PASCAL 
0 = Success
1 = Error initializing ole control
2 = No record in the database
3 = Some error when picking up fields
4 = Must have at least 2 numeric fields
5 = Maximum of 6000 records for the ole control is reached
*/

#IFDEF __DEBUG__
        cFile:="c:\cavo27a\bin\cmVodbx32Graphic.DLL"
#ELSE
        cFile:=WorkDir()+"cmVodbx32Graphic.DLL"
#ENDIF 


IF File( cFile )
        IF ptrGraphLibrary=NULL_PTR //global var, not yet loaded
                ptrGraphLibrary:=LoadLibrary(PSZ(_CAST,"cmVodbx32Graphic.DLL"))
        ENDIF 

        IF ptrGraphLibrary!= NULL_PTR //global var , dll already loaded
                pEntry := GetProcAddress( ptrGraphLibrary , PSZ(_CAST,"CallGraph") )
                IF pEntry != NULL_PTR
                        liError := LONG( _CAST , PCALL( pEntry,SELF, oServer) )
                ENDIF
        ELSE
                SELF:StatusBar:temporaryText:= "Error, loading the graphic libray [cmVodbx32Graphic.DLL]"
        ENDIF
ELSE
        SELF:StatusBar:temporaryText:= "The Graphic package is not installed. Go to About Dialog and Download"
ENDIF

//FreeLibray cause program crash. It will be free when the whole program close on closeEvent (freelibray)
//lOK:=FreeLibrary(hHandle)


IF liError = 1
        SELF:StatusBar:temporaryText:= "Error initializing ole control"
ELSEIF liError = 2
        SELF:StatusBar:temporaryText:= "No record in the database"
ELSEIF liError = 3
        SELF:StatusBar:temporaryText:= "Some error when picking up fields"
ELSEIF liError = 4
        SELF:StatusBar:temporaryText:= "Must have at least 2 numeric fields"
ELSEIF liError = 5
        SELF:StatusBar:temporaryText:= "Maximum of 6000 records for the ole control is reached"
ENDIF

3) Free the library on the close event

METHOD OnClose(oEvent AS cEvent) AS LONGINT PASCAL CLASS cShellWindow   //from main shell window Important

IF ptrGraphLibrary!=NULL_PTR
        FreeLibrary( ptrGraphLibrary )
ENDIF

RETURN SUPER:OnClose(oEvent)

Example2 of  DLL utilisation ( Prototype from within your program )

1) Load the cmVodbx32Graphic - DLL.AEF prototype in your program IDE, and link this library.

2) Call the function CallGraph() in the normal way.

Note: During development the library cmVodbx32Graphic.DLL.must be in the cavo28\bin directory ( Internally the Dll call cmGui209.Dll, cmRdd209.Dll, VO28run.Dll ) Go top


Author

Enjoy...

Jean Raymond
JR-INFO
(cmVodbx32 and RegKeyFileBuilder Publisher)


http://www.rayonline.com/jrinfo        

Jr-info@rayonline.com


2007-10-10

Go top