KRASCHE
&
BYRNE
         ELZED  HOME       NEWS       DOCS       DOWNLOADS       LICENSING       SUPPORT       FAQ       ABOUT  US

What's An Elzed?
Features
Licensing
Downloads
Documentation
Elzed News
    ELZED 
 Documentation 
 The Details 
 Integration 

Integrating Elzed on Windows

Elzed Versions

We make two versions of Elzed available for Windows:

  • elzed.lib -- library for static linking
  • elzed.dll -- library for dynamic linking

Elzed is compatible with Windows 2000 and XP. Frankly, we haven't worked up the nerve to try it out on Vista. Only Intel hardware is supported.

Both are functionally equivalent, and are integrated in largely the same way.

Bringing Elzed Into Your Project

In the following discussion, we're assuming that you're developing a Visual C++ project, or that you're developing in Visual Basic. We'll discuss Visual C++ first; scroll down for Visual Basic.

Visual C++

For statically linked Visual C++ projects, you'll need two header files: LZElzedAPI.h and LZElzedPublic.h. The first file, LZElzedAPI.h, defines the Elzed API. The other file, LZElzedPublic.h, defines constants used by many of the API calls. For dynamically linked Visual C++ projects, you will need to include one additional file: elzed_dll.h

Make sure that LZElzedAPI.h is included everywhere you will be using Elzed, either through a project setting or prefix file, or by explicit inclusion:

.
.
#include "LZElzedAPI.h"
.
.

LZElzedPublic.h is included explicitily by LZElzedAPI.h, so there's no need to refer to it elsewhere in your code.

Checking Things Out

You can verify that the library is both available and functional by making four API calls:

Call lzLoadElzed to bring the library into memory
Call lzInitialize to make the library ready to use
Call lzEvalExpStrToNum to evaluate an expression and return the answer
Call lzUnloadElzed to shut down the library and release resources

Your code should look something like this:

bool loadSuccessful = false;
double theAnswer = 0.0;

// Load Elzed and proceed if successful...
if (loadSuccessful = lzLoadElzed())  // Intentional assignment...
{
// Use your own key below, or pass NULL...
lzInitialize( "FAKE_REGISTRATION_KEY" );

// Send Elzed an expression to evaluate...
theAnswer = lzEvalExpStrToNum( "2+2" );

// Unload the library...
lzUnloadElzed();
}

The first test, obviously, is to see if your program compiles. Assuming that it does, make sure that the passed-in expression evaluates correctly. If you get the right answer, then you're ready to go. For more information, take a look at the C++ sample code.

Visual Basic

Elzed supports VB6 and VB.Net. You'll need to include the appropriate Elzed Basic code module in your project. These modules perform the same function that the elzed_dll.h header file does for Visual C++, "cracking open" the Elzed DLL and making each API call available. For VB6, include ElzedBasicVB6.bas. For VB.Net, include ElzedBasicDotNet.bas.

You can verify that the library is both available and functional by making two API calls:

Call lzInitialize to make the library ready to use
Call lzEvalExpStrToNum to evaluate an expression and return the answer

The lzLoadElzed and lzUnloadElzed calls required in VC++ are not required in VB. You can still make these calls, but they are no-ops in the VB environment.

For a simple form-based application (like the Elzed VB sample), your code should look something like this:

Private Sub Form Load()
Dim dResult As Double

'Use your own key below, or pass NULL...
lzInitialize( "FAKE_REGISTRATION_KEY" );

dResult = lzEvalExpStroNum( "2+2" )
End Sub

As with VC++, if your program runs and returns the correct answer, you're ready to go. For more information, take a look at the VB sample code.



  Copyright  ©  MMXXIV  by  R R Le Cropane   •   All Rights Reserved   •   Terms of Use   •   Privacy Policy