Brilliant Database Software - Home
Database software - Online Help System

Online Help System

Back to Brilliant Database Web-Site | Write to Support | Help Index



Creating and Using DLLs

table border="0" width="100%" cellspacing="0" cellpadding="4" bgcolor="#00000077">
Creating and Using DLLs

Using 3rd part Addons (Dlls) in Brilliant Database

In Brilliant Database, you can connect and use functions from third party dynamic libraries (dll) if they were arranged in the appropriate way. To do so, you should create a script and add to it the "Execute External Dll Proc" action with the following parameters:

  • DllName - file name of the connected library. If no file name extension is specified in the DllName parameter, the default library extension .dll is appended. However, the file name string can include a trailing point character (.) to indicate that the module name has no extension. When no path is specified, the function searches for loaded modules whose base name matches the base name of the module to be loaded. If the name matches, the load succeeds. Otherwise, the function searches for the file in the following sequence:
    • The directory from which the application loaded.
    • The current directory.
    • The 32-bit Windows system directory (by default: "C:\Windows\System32")
    • The Windows directory.
    • The directories that are listed in the PATH environment variable.
  • ProcedureName - name of the called procedure in the library.
  • ParameterA, ParameterB - string parameters passed to the procedure.

The result of the external function execution can be saved into a variable.

Creating 3rd Party Addons (Dlls) for Brilliant Database

To create additional modules for Brilliant Database, you can use any development tool, for example, Visual C++, Visual Basic, Delphi, etc. The created module should be a usual dll. All exported functions should be declared in the following way:

void __stdcall ProcedureName(char *ParameterA, char *ParameterB, char *ReturnValue)

Where:

  • ParameterA, ParameterB - text variables passed from Brilliant Database in the standard Non-unicode character encoding.
  • ReturnValue - text buffer in which the value returned by the function should be written. The limitation for the buffer size is 1 000 000 Bytes.

For example, the following simple function will display ParameterA and ParameterB in a simple message and return a string with a random number:

void __stdcall TestMessage(char *ParA, char *ParB, char *RetValue)
Unknown block:
   MESSAGEBOX(NULL,PARB,PARA,1);
   WSPRINTF(RETVALUE,"HELLO FROM DLL

If you call it from Brilliant Database with the following script:

we will see two sequential messages, the first one displayed from the dll, and the other one displayed by the script from Brilliant Database.

  

Note. When creating a dll, keep in mind that the dll in Brilliant Database is connected at the first call of any function from the given dll (LoadLibrary); when the database is closed, the dll is disconnected (FreeLibrary).



All topics in the "Creating Addons and Integration" section: