
DIDAPIUI example for Microsoft Visual Basic 6.0

This example shows how you can use Planmeca Oy's x-ray devices from Visual Basic program. Also
an executable version is included. The example has been tested with Windows 95/98/Me/NT/2000.

In the example there are a project file VBDIDAPIUIexample.vbp, a form file didapiex.frm,
module files decl.bas and didapicodes.bas and a class module DIDAPIconnect.cls.

In decl.bas module there are defined the global variables for DIDAPI and a class module for connect.
In didapicodes.bas file are defined standard DIDAPI return codes. Example has only one form: didapiex.frm.
In the class module is displayed how the call is made.

When the user clicks the button the program gathers the user defined parameters for a function call.
The parameters are device type, preview, picture depth and filename. In the class module there is defined
the function call and an extra parameter (integer array size of DIDAPI_MAX_PARAM)
which is necessary for memory management in the DLL.


Calling DIDAPIUI.DLL

The example program uses decleration:

Private Declare Function DUI_capture_image% Lib "didapiui.dll" (ByVal nshow As Integer, ByVal nimagetype As Integer, ByVal nbitdepth As Integer, ByVal filename As String, param As Any) As Integer 

And calls didapiUI with
Dim paramData(DIDAPI_MAX_PARAM) As Integer
Rc= DUI_capture_image(preView, ImageType, BitDepth, filename, paramData(0))

Please note: 
 The last parameter is pointer to an array, therefore you must give pointer to array's first index.
 You can not alter types in function call or change order of them, and all of them must have proper value.

