Hi to all,
currently i'm working on some functions implementing our dms (DocuWare) into our Progress Application. DocuWare offers two ways,
a) DLL-Functions
b) Automation
I prefered to use the dll-calls so i produced the following code exactly as the DocuWare-Documentation says:
DEFINE VARIABLE iDWToolkitSession AS INTEGER INITIAL 0 NO-UNDO.
DEFINE VARIABLE iDW4IsRunning AS INTEGER INITIAL 0 NO-UNDO.
DEFINE VARIABLE iDWResultListHandle AS INTEGER NO-UNDO.
DEFINE VARIABLE cExportedFiles AS CHARACTER NO-UNDO.
DEFINE VARIABLE iDWResult AS INTEGER NO-UNDO.
/* Procedure definitions */
PROCEDURE DWTKGetSessionHandle EXTERNAL "DWTKDLL.DLL":
DEFINE INPUT PARAMETER hParentWindow AS LONG.
DEFINE OUTPUT PARAMETER lToolkitSession AS LONG.
DEFINE RETURN PARAMETER iResult AS LONG.
END.
PROCEDURE DWTKFreeSessionHandle EXTERNAL "DWTKDLL.DLL":
DEFINE INPUT PARAMETER lToolkitSession AS LONG.
DEFINE RETURN PARAMETER iResult AS LONG.
END.
PROCEDURE DWTKIsDW4Running EXTERNAL "DWTKDLL.DLL":
DEFINE INPUT PARAMETER lToolkitSessionHandle AS LONG.
DEFINE OUTPUT PARAMETER bDW4IsRunning AS LONG.
DEFINE RETURN PARAMETER iResult AS LONG.
END.
PROCEDURE DWTKStartDocuWare EXTERNAL "DWTKDLL.DLL":
DEFINE INPUT PARAMETER plToolkitSession AS LONG.
DEFINE INPUT PARAMETER pcUsername AS CHARACTER.
DEFINE INPUT PARAMETER pcPassword AS CHARACTER.
DEFINE INPUT PARAMETER plTimeout AS LONG.
DEFINE RETURN PARAMETER iResult AS LONG.
END.
/* ------------------------------------------------------------------------------ */
RUN DWTKGetSessionHandle (INPUT CURRENT-WINDOW:HWND,
OUTPUT iDWToolkitSession,
OUTPUT iDWResult).
/* For DEBUG */
MESSAGE Integer(iDWToolkitSession) SKIP
Integer(iDWResult) VIEW-AS ALERT-BOX INFORMATION.
/* ------------------------------------------------------------------------------ */
RUN DWTKIsDW4Running (INPUT iDWToolkitSession,
OUTPUT iDW4IsRunning,
OUTPUT iDWResult).
/* For DEBUG */
MESSAGE iDW4IsRunning SKIP
iDWResult VIEW-AS ALERT-BOX INFORMATION.
/* ------------------------------------------------------------------------------ */
RUN DWTKFreeSessionHandle (INPUT iDWToolkitSession,
OUTPUT iDWResult).
/* For DEBUG */
MESSAGE iDWResult VIEW-AS ALERT-BOX INFORMATION.
After calling the function "DWTKGetSessionHandle" i get the following result:
iDWToolkitSession is a eight figures long integer (i don't know if this is the right translation).
iDWResult is 0 <- this means the function suceeded :awink:
Then calling the DWTKIsDW4Running function with the above Session-Number fails with iDWResult = -2147221503. This code means "False parameter".
I must wonder about this, because the code above worked for five or six times and since last week it doesn't work any more.
The same calls run in VB without any error. The only difference is, that the Session-Handle i get in VB is a nine figures long number.
These are my questions:
a) is there a limitation so that progress can handle only eight figures long numbers in external dll functions?
b) If it is so, is there a work around?
Progress version is currently 9.1D09 on Windows XP.
Thanks in advance for any help!!!
Marcus.
currently i'm working on some functions implementing our dms (DocuWare) into our Progress Application. DocuWare offers two ways,
a) DLL-Functions
b) Automation
I prefered to use the dll-calls so i produced the following code exactly as the DocuWare-Documentation says:
DEFINE VARIABLE iDWToolkitSession AS INTEGER INITIAL 0 NO-UNDO.
DEFINE VARIABLE iDW4IsRunning AS INTEGER INITIAL 0 NO-UNDO.
DEFINE VARIABLE iDWResultListHandle AS INTEGER NO-UNDO.
DEFINE VARIABLE cExportedFiles AS CHARACTER NO-UNDO.
DEFINE VARIABLE iDWResult AS INTEGER NO-UNDO.
/* Procedure definitions */
PROCEDURE DWTKGetSessionHandle EXTERNAL "DWTKDLL.DLL":
DEFINE INPUT PARAMETER hParentWindow AS LONG.
DEFINE OUTPUT PARAMETER lToolkitSession AS LONG.
DEFINE RETURN PARAMETER iResult AS LONG.
END.
PROCEDURE DWTKFreeSessionHandle EXTERNAL "DWTKDLL.DLL":
DEFINE INPUT PARAMETER lToolkitSession AS LONG.
DEFINE RETURN PARAMETER iResult AS LONG.
END.
PROCEDURE DWTKIsDW4Running EXTERNAL "DWTKDLL.DLL":
DEFINE INPUT PARAMETER lToolkitSessionHandle AS LONG.
DEFINE OUTPUT PARAMETER bDW4IsRunning AS LONG.
DEFINE RETURN PARAMETER iResult AS LONG.
END.
PROCEDURE DWTKStartDocuWare EXTERNAL "DWTKDLL.DLL":
DEFINE INPUT PARAMETER plToolkitSession AS LONG.
DEFINE INPUT PARAMETER pcUsername AS CHARACTER.
DEFINE INPUT PARAMETER pcPassword AS CHARACTER.
DEFINE INPUT PARAMETER plTimeout AS LONG.
DEFINE RETURN PARAMETER iResult AS LONG.
END.
/* ------------------------------------------------------------------------------ */
RUN DWTKGetSessionHandle (INPUT CURRENT-WINDOW:HWND,
OUTPUT iDWToolkitSession,
OUTPUT iDWResult).
/* For DEBUG */
MESSAGE Integer(iDWToolkitSession) SKIP
Integer(iDWResult) VIEW-AS ALERT-BOX INFORMATION.
/* ------------------------------------------------------------------------------ */
RUN DWTKIsDW4Running (INPUT iDWToolkitSession,
OUTPUT iDW4IsRunning,
OUTPUT iDWResult).
/* For DEBUG */
MESSAGE iDW4IsRunning SKIP
iDWResult VIEW-AS ALERT-BOX INFORMATION.
/* ------------------------------------------------------------------------------ */
RUN DWTKFreeSessionHandle (INPUT iDWToolkitSession,
OUTPUT iDWResult).
/* For DEBUG */
MESSAGE iDWResult VIEW-AS ALERT-BOX INFORMATION.
After calling the function "DWTKGetSessionHandle" i get the following result:
iDWToolkitSession is a eight figures long integer (i don't know if this is the right translation).
iDWResult is 0 <- this means the function suceeded :awink:
Then calling the DWTKIsDW4Running function with the above Session-Number fails with iDWResult = -2147221503. This code means "False parameter".
I must wonder about this, because the code above worked for five or six times and since last week it doesn't work any more.
The same calls run in VB without any error. The only difference is, that the Session-Handle i get in VB is a nine figures long number.
These are my questions:
a) is there a limitation so that progress can handle only eight figures long numbers in external dll functions?
b) If it is so, is there a work around?
Progress version is currently 9.1D09 on Windows XP.
Thanks in advance for any help!!!
Marcus.