I am having a problem running the following DLL code. Everything seems to work. The value 123 gets from the .efs program to the DLL and is displayed. The DLL returns the value 100 to the .efs program which uses the debugPrint function to display the value. After this I get the "division by zero" error message shown below. I have reduced the code to the very minimum and have included it below. If anyone can help me any suggestions or locations of more info I would be very grateful.
Borland Builder DLL code:
Include File
---------------------------------------------------------------------------
#ifndef eSigDataH
#define eSigDataH
extern "C" int __declspec(dllexport) __cdecl OpenVar(int iOpen);
#endif
---------------------------------------------------------------------------
Source File
---------------------------------------------------------------------------
#pragma hdrstop
#include "eSigData.h"
#include "Dialogs.hpp"
#pragma package(smart_init)
int OpenVar(int iOpen)
{
ShowMessage("This is from within the DLL\n" + String(iOpen));
return (100);
}
---------------------------------------------------------------------------
DLLTest.efs File
---------------------------------------------------------------------------
var dllOut = new DLL("D:/Projects/eSigDDE.dll");
dllOut.addFunction ("OpenData", DLL.INT, DLL.CDECL, "_OpenVar", DLL.INT);
var test = 123;
function preMain()
{
var v = dllOut.call ("OpenData", test);
debugPrint("v = " + v + "\n");
}
function main()
{
}
function postMain()
{
}
---------------------------------------------------------------------------
Error message
---------------------------------------------------------------------------
esigdde:winsig.exe - Application Error
The exception Floating-point division by zero.
(0xc000008e) occurred in the application at location 0x00495561
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------------------------------------------------------
Borland Builder DLL code:
Include File
---------------------------------------------------------------------------
#ifndef eSigDataH
#define eSigDataH
extern "C" int __declspec(dllexport) __cdecl OpenVar(int iOpen);
#endif
---------------------------------------------------------------------------
Source File
---------------------------------------------------------------------------
#pragma hdrstop
#include "eSigData.h"
#include "Dialogs.hpp"
#pragma package(smart_init)
int OpenVar(int iOpen)
{
ShowMessage("This is from within the DLL\n" + String(iOpen));
return (100);
}
---------------------------------------------------------------------------
DLLTest.efs File
---------------------------------------------------------------------------
var dllOut = new DLL("D:/Projects/eSigDDE.dll");
dllOut.addFunction ("OpenData", DLL.INT, DLL.CDECL, "_OpenVar", DLL.INT);
var test = 123;
function preMain()
{
var v = dllOut.call ("OpenData", test);
debugPrint("v = " + v + "\n");
}
function main()
{
}
function postMain()
{
}
---------------------------------------------------------------------------
Error message
---------------------------------------------------------------------------
esigdde:winsig.exe - Application Error
The exception Floating-point division by zero.
(0xc000008e) occurred in the application at location 0x00495561
Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------------------------------------------------------
Comment