Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error 2027 DLL Caused an Exception
Message
 
 
To
10/02/2014 15:16:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01593920
Message ID:
01593921
Views:
67
>Hi,
>
>Using PDF2Vec SDK I am converting PDF files to PS. Things are going fine unless I incorporate Parallel Fox.
>
>After inclusion of Parallel Fox, performance is tremendous. But I am getting Error No 2027 DLL caused an Exception.
>
>Kindly guide, how to overcome it. Is there any mistake in my code. I am Getting the above error in PDF2PS conversion and not in ps2PDF conversion.
>
>Thanks.
>
>Here is My code.
>
>
>
>
>SELECT Convert
>nRECCOUNTCONVERT=ALLTRIM(STR(RECCOUNT()))
>cRECCOUNTCONVERT=' of '+ALLTRIM(STR(RECCOUNT()))
>Local loMyObject
>loMyObject = CreateObject("MyObject")
>loMyObject.Mainprocess()
>Return
>
>DEFINE CLASS MyObject AS Custom
>PROCEDURE Mainprocess
>Local Parallel as Parallel
>Parallel = NewObject("Parallel", "ParallelFox.vcx")
>Parallel.SetWorkerCount(Parallel.CPUCount)
>Parallel.StartWorkers()
>
>SCAN && Converts PS2PDF
>iFilename=ALLTRIM(Fullpath)
>oFilename=ALLTRIM(Newpath)
>RCNON=Recno()
>Parallel.CallMethod("ps2pdf", This.Class, This.ClassLibrary,,,iFilename,oFilename,RCNON)
>ENDSCAN
>
>SCAN  && Converts PDF2PS
>oFilename=ALLTRIM(Fullpath)
>iFilename=ALLTRIM(Newpath)
>RCNON=Recno()
>Parallel.CallMethod("Pdf2Ps", This.Class, This.ClassLibrary,,,oFilename,iFilename,RCNON)
>ENDSCAN
>Parallel.Wait
>Parallel.StopWorkers()
>ENDPROC
>
>** Convert ps files to PDF Using ps2PDF.Dll
>PROCEDURE ps2PDF
>PARAMETERS iFilename,oFilename,RCNON
>DECLARE INTEGER _apCreate@0   IN ps2pdf.dll AS apCreate
>DECLARE         _apClose@4    IN ps2pdf.dll AS apClose   INTEGER id
>DECLARE INTEGER _apConvert@4  IN ps2pdf.dll AS apConvert INTEGER id
>DECLARE INTEGER _apSetFunc@24 IN ps2pdf.dll AS apSetFunc INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2
>DECLARE INTEGER _apGetFunc@24 IN ps2pdf.dll AS apGetFunc INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2
>#define AP_Set_Output     3000
>#define AP_Set_Input      3001
>id=apCreate()
>IF (id # 0)
>apSetFunc(id, AP_Set_Input , 0, 0,iFilename, 0)  &&input file.
>apSetFunc(id, AP_Set_Output, 0, 0,oFilename, 0) &&output format and file.
>apConvert(id)
>apClose(id)
>Sys(2335, 1)	&& disable unattended mode, allow UI
>WAIT WINDOW 'Converting to PDF..'+ALLTRIM(STR(RCNON)) NOWAIT
>*Worker.UpdateProgress(RECNO(), "Converting..")
>ENDIF
>ENDPROC
>
>PROCEDURE PDF2PS
>PARAMETERS oFilename,iFilename,RCNON
>Declare INTEGER VeryPDF_PDF2Vector in pdf2vec.dll String strCommandLine
>Strcmd= 'pdf2vec -$ XXXXXXXXXXXXXXXX '+CHR(34)+iFilename+CHR(34)+" "+CHR(34)+oFilename+CHR(34)
>nRet = VeryPDF_PDF2Vector(strcmd)
>Sys(2335, 1)	&& disable unattended mode, allow UI
>WAIT WINDOW 'Converting to PS..'+ALLTRIM(STR(RCNON)) NOWAIT
>RETURN
>ENDPROC
>ENDDEFINE
>
>
Did you test your PDF2PS function standalone?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform