VBCall - Call your jBC subroutines directly from Visual BASIC


jBASE for NT and Windows 9x now ships with a Visual Basic OLE Automation interface. This interface should be usable by other systems that understand OLE Automation Variables.

Because your original BASIC subroutines are compiled by jBASE into C functions by the jBASE compiler, they are available to any program that can call C functions. The subroutines are collected together - automatically of course - in .DLL files that can be located anywhere within your Windows system.

However, if you want to call them from systems that don't understand what a jBASE variable is you would have to convert the data types yourself before calling the subroutines. Obviously, this would quickly become a pain to maintain. Therefore the first development in the jBASE OBjEX product line was the VB Call Automation Interface. With one global declaration in your Visual BASIC (or other OLE aware system), you can now call any subroutine compiled by jBASE and pass to it any OLE Automation variable as a parameter. The jBASE Automation Interface will do the rest; your subroutine will be called with jBASE variables.

The subroutine does not know, or need to know, anything about who or what called it or what data type it was really passed. It carries out its assigned task and then does a RETURN as normal. If it has changed any of the variables it was passed, these changes will be reflected automatically in the calling program's OLE variables.

Is this efficient, or are we pulling a fast one here?

If you are wondering how efficient this is (and you should) you need to take a step backwards and think about how jBASE is implemented:

  1. There is no interpreter to start up, your subroutine is in a standard DLL file on Windows;
  2. Your subroutine is real machine code;
  3. There is no environment engine to start up;
  4. The overhead of calling a C function is very small;

Hence, load times and response times are excellent and the use of jBASE subroutines does not introduce any noticeable overhead. In fact jBASE BASIC (jBC) is a lot more efficient than Visual BASIC. However, we now recommend jBASE OBjEX as the way to go to integrate your jBASE stuff with Windows properly.

Download the OLE Calling Interface

Click on the link below to receive the calling interface for VB. This is a ZIP file which contains the calling DLL and some example projects in Visual Basic. Please read the README.TXT within the ZIP file before reporting any problems!.

Select jBASE 2.0/3.0 or jBASE 3.1

 

jBASE OBjEX

This is 32 bit OLE Type Library that allows you to use the jBASE jEDI interface to open files (rather than mess with SQL), declare Dynamic Arrays and use jBASE functions and statements within OLE aware systems such as Visual BASIC 6.

This will allow you to write code like this:

In other words, you can program in Pick BASIC (now called jBC), right within your Visual BASIC Project.

Glossary of Terms

Common Object Model
The Common Object Model (acronym COM) is the base technology of OLE and all OLE related things. It is a basic set of interfaces and objects from which you build the basics of your OLE objects.
 
OCX
Object Control Extensions. OLE provides new controls to applications and developers (such as VB4 developers) via a format called OCX. This is kind of a super VBX.
 
OLE
Object Linking and Embedding. This is Microsoft's flagship technology for system and application integration and cooperation. Objects implement interfaces to the outside world using a Common Object Model so that any program or object that is OLE aware can use the object. You plug lots of OLE Objects together and create system that the original designers did not originally envisage.
 
OLE Automation Variables
This is essentially a particular set of data bearing objects (variables essentially) that implement a common interface. This allows an OLE programmer to add new variable types to OLE aware systems. Note that we use the word variable loosely; many variables you are familiar with are implemented using OLE Automation variables in Visual BASIC 6, such as Variants and Objects but an Automation type does not necessarily have to be a variable in the classic sense. You can add to the range of OLE Automation types yourself by creating an object that implements the required interfaces.
 
Type Library
A type library is used by OLE to determine the nature of functions and objects that are available to it. It basically describes how to call things, perform type coercion and how to identify objects.

© 1999 jBASE Software, Inc. All rights reserved. All trademarks on this page are recognized.

Last update: June 2, 1999.

Back to jBASE Software Home Page.