Using SAPALink SDK with C++ Implementation - Basic implementation of SAPALink SDK in C++
In order to implement SAPALink in C++ you may use the Visual C++-project which is included within the ZIP-container you downloaded from KGS website.
Please note: Depending on the version of Visual Studio you’re using, Visual Studio might upgrade the project to a newer version.
The project is located here <Unpacked directory path>\SAPALink_SDK_v210H-2\CPlusPlus\SAPALINK\SAPALINK.dsw .
When opened (and if necessary updated to a newer project version) you’ll find within the project in Visual Studio the DMS.cpp-file.
Within this class file you may find the method bodies as well as some comments regarding the functions, results and parameters.
LinkOpen - as provided
// --------------------------------------------------------------------
// Function: LinkOpen
//
// Initialize the DLL (these function will be called first ) and returns version
// info for logging ...
//
// Parameter: OUT: bstrVendor -> Vendor Archiveproduct
// OUT: bstrProductName -> Productname Archive
// OUT: bstrDLLVersion -> DLL Version String
// OUT: bstrDMSVersion -> DMS Version String
//
// Returncode: DMSRET_OK function sucessful
// --------------------------------------------------------------------
short CDMS::LinkOpen(BSTR *bstrVendor,BSTR *bstrProductName,BSTR *bstrDLLVersion, BSTR *bstrDMSVersion)
{
short nRetCode=DMSRET_OK;
CString csStr;
if (bstrVendor)
{
csStr="VendorName .....";
*bstrVendor=csStr.AllocSysString();
}
if (bstrProductName)
{
csStr="ProductName .....";
*bstrProductName=csStr.AllocSysString();
}
if (bstrDMSVersion)
{
csStr="DMSVersion .....";
*bstrDMSVersion=csStr.AllocSysString();
}
if (bstrDLLVersion)
{
csStr="SAPALINK.DLL Version 01.00";
*bstrDLLVersion=csStr.AllocSysString();
}
m_nRefCnt++;
return nRetCode;
}Within this method you may define the vendor name, product name, the version of your DMS system as well as the DLL version.
A sample implementation is provided below.
Please note: All four parameters need to be provided in order to get a properly initialized SAPALink implementation.
Please note also: It’s strongly recommended, that you refrain from using special characters (including UTF-8).
// --------------------------------------------------------------------
// Function: LinkOpen
//
// Initialize the DLL (these function will be called first ) and returns version
// info for logging ...
//
// Parameter: OUT: bstrVendor -> Vendor Archiveproduct
// OUT: bstrProductName -> Productname Archive
// OUT: bstrDLLVersion -> DLL Version String
// OUT: bstrDMSVersion -> DMS Version String
//
// Returncode: DMSRET_OK function sucessful
// --------------------------------------------------------------------
short CDMS::LinkOpen(BSTR *bstrVendor,BSTR *bstrProductName,BSTR *bstrDLLVersion, BSTR *bstrDMSVersion)
{
//AppendCallToTextFile("LinkOpen");
short nRetCode=DMSRET_OK;
CString csStr;
if (bstrVendor)
{
csStr="KGS Software GmbH";
*bstrVendor=csStr.AllocSysString();
}
if (bstrProductName)
{
csStr="KGS-SAPALINK-Teststore";
*bstrProductName=csStr.AllocSysString();
}
if (bstrDMSVersion)
{
csStr="1.0.0.0.1";
*bstrDMSVersion=csStr.AllocSysString();
}
if (bstrDLLVersion)
{
csStr="KGS-SAPALINK-Teststore 1.0.0.0.1";
*bstrDLLVersion=csStr.AllocSysString();
}
m_nRefCnt++;
return nRetCode;
}In order to test your implementation, you may compile your implementation (either against x86 resulting in 32-bit-library or against x64 which will result in a 64-bit-library depending on your OS, Java, and webserver), copy the resulting SAPALINK.dll-file to your web server as well as the files and libraries described within the next section and configure it like described.