gerne.
Geändert habe ich noch die PDF/A Version von 3a auf 2a und zum Test und jetzt im Einsatz ist das Exportmodul 27.005.
Der von Combit mitgelieferte Wrapper lädt die DLL und erstellt die Call-Templates Chaotisch unter umständen über viele Worker Threads des WebServers verteilt lädt er die Call-Templates in viele viele Static Vars.
Ich bin jetzt hingegangen und lade das gezielt früh beim Programmstart mit der Funktion LoadListLabelDLL() // siehe unten // diese erstellt die NUR die in allen meinen Programmen benötigten Templates im MainThread und speichert diese in einem STATIC Array. Gleichzeitig wird auch der "Schutz-Job" oder Dummy Job angelegt. Die zur Laufzeit benötigten Funktionen sind alle Fix und greifen auf das eine Static Array zu.
Eine Erklährung wieso es so funktioniert habe ich keine. Auch nach vielen 10'000 erstellten PDF konnte auch der Web-Stresstest das Servermodul nicht mehr killen. Ich hatte das Problem mit einer anderen DLL schon mal die Funktioniert auch nur mit aufrufen auf diese Art.....
Im folgenden Code sind die wesentlichen Teile. Ein Modulexit oder DLLunload braucht es nicht. (Hoffentlich habe ich nicht zuviel rausgeschnitten)
Code: Alles auswählen
#include "dll.ch"
#include "fileio.ch"
#include "\apps\ListLabelXX\cmbtllXX.ch"
#include "common.ch"
#define CRLF (Chr(13)+Chr(10))
#DEFINE LIZENZSTRING "XXXXXXXXXXXXXXXXXX"
#DEFINE MAIN_DLLNAME "CMLL27.DLL"
static saCallLL := nil
static hDll := 0
* ---------------------------------------------------------------------------------
* DLL-Laden
*
*
function LoadListLabelDLL( cVersion )
local ret_val := .t.
cVersion := ""
If !LLXXModuleInit()
logEXEerror( "Error loading " + MAIN_DLLNAME+ " / OS error#"+Alltrim(Str(DosError())) +"/"+DosErrorMessage(DosError())+ CRLF )
ret_val := .f.
else
cVersion := alltrim(str(LlGetVersion(LL_VERSION_MAJOR)))+"."+ alltrim(str(LlGetVersion(LL_VERSION_MINOR)))
endif
return(ret_val)
static function LLxxModuleInit()
if hDll == 0
hDll := DllLoad(MAIN_DLLNAME)
if ! hDll == 0
__LLInit()
LLOpenPrintJob()
endif
endif
return(hDll # 0)
//MARKER:MAKELLFUNC
// -------------------------------------------------------------------
//
// ACHTUNG: Ab hier wird der Code durch makeLLfunc.exe automatisch erstellt --> Es darf nichts ge„ndert werden !!!
//
// -------------------------------------------------------------------
static function __LLInit()
local i, imax
local aFuncList := {;
10,; // LlJobOpen
14,; // LlGetVersion
66,; // LlSetOptionString
13,; // LlSetDebug
26,; // LlDefineVariableStart
70,; // LlDesignerProhibitAction
202,; // LlViewerProhibitAction
64,; // LlSetOption
11,; // LlJobClose
31,; // LlPreviewSetTempPath
200,; // LlSetPrinterDefaultsDir
32,; // LlPreviewDeleteFiles
53,; // LlPrintStart
68,; // LlPrintSetOptionString
246,; // LlXSetParameter
248,; // LlPrintResetProjectState
38,; // LlPrintEnd
28,; // LlDefineLayout
19,; // LlDefineFieldExt
23,; // LlDefineVariableExt
59,; // LlExprParse
63,; // LlExprEvaluate
62,; // LlExprFree
35,; // LlPrint
39,; // LlPrintFields
40,; // LlPrintFieldsEnd
219,; // LlGetErrortext
54,; // LlPrintWithBoxStart
77,; // LlPrintOptionsDialogTitle
51,; // LlPrintSetOption
96,; // LlGetVariableType
92,; // LlGetVariableContents
214,; // LlProjectOpen
206,; // LlDomGetProject
209,; // LlDomGetObject
210,; // LlDomGetSubobjectCount
211,; // LlDomGetSubobject
207,; // LlDomGetProperty
208,; // LlDomSetProperty
215,; // LlProjectSave
216,; // LlProjectClose
50,; // LlPrintSetBoxText
56,; // LlSelectFileDlgTitleEx
44,; // LlPrintGetRemainingItemsPerTable
43,; // LlPrintGetItemsPerTable
258,; // LlGetUsedIdentifiersEx
245; // LlPrintResetObjectStates
}
imax := Len(aFuncList)
saCallLL := Array(imax)
for i := 1 to imax
saCallLL[i] := DllPrepareCall( hDll, DLL_STDCALL, aFuncList[i] )
next
return(.t.)
// ---------------------------------------------
function LlJobOpen(nLanguage)
return( DllExecuteCall( saCallLL[1], nLanguage) )
// ---------------------------------------------
function LlGetVersion(nCmd)
return( DllExecuteCall( saCallLL[2], nCmd) )
// ---------------------------------------------
function LlSetOptionString(hLlJob, nIndex, pszBuffer)
return( DllExecuteCall( saCallLL[3], hLlJob, nIndex, @pszBuffer) )
// ---------------------------------------------
procedure LlSetDebug(nOnOff)
DllExecuteCall( saCallLL[4], nOnOff)
return
// ---------------------------------------------
procedure LlDefineVariableStart(hLlJob)
DllExecuteCall( saCallLL[5], hLlJob)
return
// ---------------------------------------------
function LlDesignerProhibitAction(hLlJob, nMenuID)
return( DllExecuteCall( saCallLL[6], hLlJob, nMenuID) )
// ---------------------------------------------
function LlViewerProhibitAction(hLlJob, nMenuID)
return( DllExecuteCall( saCallLL[7], hLlJob, nMenuID) )
// ---------------------------------------------
function LlSetOption(hLlJob, nMode, nValue)
return( DllExecuteCall( saCallLL[8], hLlJob, nMode, nValue) )
// ---------------------------------------------
procedure LlJobClose(hLlJob)
DllExecuteCall( saCallLL[9], hLlJob)
return
// ---------------------------------------------
function LlPreviewSetTempPath(hLlJob, pszPath)
return( DllExecuteCall( saCallLL[10], hLlJob, @pszPath) )
// ---------------------------------------------
function LlSetPrinterDefaultsDir(hLlJob, pszDir)
return( DllExecuteCall( saCallLL[11], hLlJob, @pszDir) )
// ---------------------------------------------
function LlPreviewDeleteFiles(hLlJob, pszObjName, pszPath)
return( DllExecuteCall( saCallLL[12], hLlJob, @pszObjName, @pszPath) )
// ---------------------------------------------
function LlPrintStart(hLlJob, nObjType, pszObjName, nPrintOptions, nReserved)
return( DllExecuteCall( saCallLL[13], hLlJob, nObjType, @pszObjName, nPrintOptions, nReserved) )
// ---------------------------------------------
function LlPrintSetOptionString(hLlJob, nIndex, pszBuffer)
return( DllExecuteCall( saCallLL[14], hLlJob, nIndex, @pszBuffer) )
// ---------------------------------------------
function LlXSetParameter(hLlJob, nExtensionType, pszExtensionName, pszKey, pszValue)
return( DllExecuteCall( saCallLL[15], hLlJob, nExtensionType, @pszExtensionName, @pszKey, @pszValue) )
// ---------------------------------------------
function LlPrintResetProjectState(hJob)
return( DllExecuteCall( saCallLL[16], hJob) )
// ---------------------------------------------
function LlPrintEnd(hLlJob, nPages)
return( DllExecuteCall( saCallLL[17], hLlJob, nPages) )
// ---------------------------------------------
function LlDefineLayout(hLlJob, hWnd, pszTitle, nObjType, pszObjName)
return( DllExecuteCall( saCallLL[18], hLlJob, hWnd, @pszTitle, nObjType, @pszObjName) )
// ---------------------------------------------
function LlDefineFieldExt(hLlJob, pszVarName, lpbufContents, lPara, lpPtr)
return( DllExecuteCall( saCallLL[19], hLlJob, @pszVarName, @lpbufContents, lPara, lpPtr) )
// ---------------------------------------------
function LlDefineVariableExt(hLlJob, pszVarName, lpbufContents, lPara, lpPtr)
return( DllExecuteCall( saCallLL[20], hLlJob, @pszVarName, @lpbufContents, lPara, lpPtr) )
// ---------------------------------------------
function LlExprParse(hLlJob, lpExprText, bIncludeFields)
return( DllExecuteCall( saCallLL[21], hLlJob, @lpExprText, bIncludeFields) )
// ---------------------------------------------
function LlExprEvaluate(hLlJob, lpExpr, pszBuf, nBufSize)
return( DllExecuteCall( saCallLL[22], hLlJob, lpExpr, @pszBuf, nBufSize) )
// ---------------------------------------------
procedure LlExprFree(hLlJob, lpExpr)
DllExecuteCall( saCallLL[23], hLlJob, lpExpr)
return
// ---------------------------------------------
function LlPrint(hLlJob)
return( DllExecuteCall( saCallLL[24], hLlJob) )
// ---------------------------------------------
function LlPrintFields(hLlJob)
return( DllExecuteCall( saCallLL[25], hLlJob) )
// ---------------------------------------------
function LlPrintFieldsEnd(hLlJob)
return( DllExecuteCall( saCallLL[26], hLlJob) )
// ---------------------------------------------
function LlGetErrortext(nError, pszBuffer, nBufSize)
return( DllExecuteCall( saCallLL[27], nError, @pszBuffer, nBufSize) )
// ---------------------------------------------
function LlPrintWithBoxStart(hLlJob, nObjType, pszObjName, nPrintOptions, nBoxType, hWnd, pszTitle)
return( DllExecuteCall( saCallLL[28], hLlJob, nObjType, @pszObjName, nPrintOptions, nBoxType, hWnd, @pszTitle) )
// ---------------------------------------------
function LlPrintOptionsDialogTitle(hLlJob, hWnd, pszTitle, pszText)
return( DllExecuteCall( saCallLL[29], hLlJob, hWnd, @pszTitle, @pszText) )
// ---------------------------------------------
function LlPrintSetOption(hLlJob, nIndex, nValue)
return( DllExecuteCall( saCallLL[30], hLlJob, nIndex, nValue) )
// ---------------------------------------------
function LlGetVariableType(hLlJob, pszName)
return( DllExecuteCall( saCallLL[31], hLlJob, @pszName) )
// ---------------------------------------------
function LlGetVariableContents(hLlJob, pszName, pszBuffer, nBufSize)
return( DllExecuteCall( saCallLL[32], hLlJob, @pszName, @pszBuffer, nBufSize) )
// ---------------------------------------------
function LlProjectOpen(hLlJob, nObjType, pszObjName, nOpenMode)
return( DllExecuteCall( saCallLL[33], hLlJob, nObjType, @pszObjName, nOpenMode) )
// ---------------------------------------------
function LlDomGetProject(hLlJob, phDOMObj)
return( DllExecuteCall( saCallLL[34], hLlJob, @phDOMObj) )
// ---------------------------------------------
function LlDomGetObject(hDOMObj, pszName, phDOMSubObj)
return( DllExecuteCall( saCallLL[35], hDOMObj, @pszName, @phDOMSubObj) )
// ---------------------------------------------
function LlDomGetSubobjectCount(hDOMObj, pnCount)
return( DllExecuteCall( saCallLL[36], hDOMObj, @pnCount) )
// ---------------------------------------------
function LlDomGetSubobject(hDOMObj, nPosition, phDOMSubObj)
return( DllExecuteCall( saCallLL[37], hDOMObj, nPosition, @phDOMSubObj) )
// ---------------------------------------------
function LlDomGetProperty(hDOMObj, pszName, pszBuffer, nBufSize)
return( DllExecuteCall( saCallLL[38], hDOMObj, @pszName, @pszBuffer, nBufSize) )
// ---------------------------------------------
function LlDomSetProperty(hDOMObj, pszName, pszValue)
return( DllExecuteCall( saCallLL[39], hDOMObj, @pszName, @pszValue) )
// ---------------------------------------------
function LlProjectSave(hLlJob, pszObjName)
return( DllExecuteCall( saCallLL[40], hLlJob, @pszObjName) )
// ---------------------------------------------
function LlProjectClose(hLlJob)
return( DllExecuteCall( saCallLL[41], hLlJob) )
// ---------------------------------------------
function LlPrintSetBoxText(hLlJob, szText, nPercentage)
return( DllExecuteCall( saCallLL[42], hLlJob, @szText, nPercentage) )
// ---------------------------------------------
function LlSelectFileDlgTitleEx(hLlJob, hWnd, pszTitle, nObjType, pszObjName, nBufSize, pReserved)
return( DllExecuteCall( saCallLL[43], hLlJob, hWnd, @pszTitle, nObjType, @pszObjName, nBufSize, pReserved) )
// ---------------------------------------------
function LlPrintGetRemainingItemsPerTable(hLlJob, pszField)
return( DllExecuteCall( saCallLL[44], hLlJob, @pszField) )
// ---------------------------------------------
function LlPrintGetItemsPerTable(hLlJob)
return( DllExecuteCall( saCallLL[45], hLlJob) )
// ---------------------------------------------
function LlGetUsedIdentifiersEx(hLlJob, pszProjectName, nIdentifierTypes, pszBuffer, nBufSize)
return( DllExecuteCall( saCallLL[46], hLlJob, @pszProjectName, nIdentifierTypes, @pszBuffer, nBufSize) )
// ---------------------------------------------
function LlPrintResetObjectStates(hLlJob)
return( DllExecuteCall( saCallLL[47], hLlJob) )
// ---------------------------------------------