Integration With GMS
We have been asked many times about how to integrate GMS into a new Accounting system. We have now moved all accounting functions out of GMS in to a Active X DLL. If you would like to interface your accounting system with GMS it requires the following.
a copy of our GMSAccounting.dll, and an Programming language capable of producing an Active X Component library.
simply Register our DLL and start a new project using the GMS DLL as a base library. This will leave you with a set of functions and some data structures that you will need in order to tie our systems together. You will not need to know anything about how GMS works in order to do this.
To Use your new Interface simply register it, and put the GUID ID number into the GMS setup screen.
for more information and a copy of the DLL please contact us at development@gmsgrain.com
an example Data Structure (in Delphi) This is from the auto generated include file.
IGMSCurrency = interface(IDispatch)
['{B42F53C4-2A8E-4B56-A5E2-3B59E0BFF373}']
function Get_code: WideString; safecall;
procedure Set_code(const pRetVal: WideString); safecall;
function Get_description: WideString; safecall;
procedure Set_description(const pRetVal: WideString); safecall;
property code: WideString read Get_code write Set_code;
property description: WideString read Get_description write Set_description;
end;
CoGMSCurrency = class
class function Create: IGMSCurrency;
end;
An Example of the Code to Use the Data Structure Passed by GMS
function TYourModual.GetCurrencies: IGMSCurrencyList;
var
list : IGMSCurrencyList;
Currency : IGMSCurrency;
begin
// this function is called by GMS to get a list of available Curencies suported by the Accounting System.
// Create a new list object
list:= coGMSCurrencyList.Create as IGMSCurrencyList;// qryGetId is an SQL query defined elsewere in the code
qryGetId.SQL.Text:='select * from tcurrncy';
qryGetId.Active:=true;while not qryGetID.Eof do
begin// Create new data object to add to list
Currency := coGMSCurrency.create as IGMSCurrency;
// set the properties of the data object
Currency.code := qryGetId.FieldByName('lId').AsString;
Currency.description := qryGetId.FieldByName('sDesc').AsString;
// Add the data to the list
list.Add(Currency);
qryGetID.Next;end;
qryGetId.Active:=false;
// pass the data back to GMS to Process
result:=list;
end;