Strange OLE Error

Discussions about image processing and document imaging.
Post Reply
clocklear
Posts: 16
Joined: Fri Jan 11, 2008 11:04 pm

Strange OLE Error

Post by clocklear » Thu Apr 17, 2008 2:48 pm

Hi,

I wrote an addon for my software that will allow the end user to append documents from a TWAIN source to an existing document. The code works fine on my development machine, but I get the following error on every other machine I try it on.
Image

The problem appears to be occuring when I execute the following code:

Code: Select all

PROCEDURE Merge2PDF
	LPARAMETERS cInPDFPath1, cInPDFPath2, cOutPDFpath

	oImaging.PdfNewPdf (cOutPDFpath)
	oGdViewer.LockControl = .T.
	nImageCount = 0

	oGdViewer.DisplayFromPdfFile (cInPDFPath1)
	FOR nCpt = 1 TO oGdViewer.NumPages
		oGdViewer.DisplayFrame (nCpt)
		IF oImaging.PdfAddImageFromImageID(oGdViewer.GetNativeImage) <> 0
			nImageCount = nImageCount + 1
		ENDIF
	ENDFOR
	oGdViewer.CloseImage

	oGdViewer.DisplayFromPdfFile (cInPDFPath2)
	FOR nCpt = 1 TO oGdViewer.NumPages
		oGdViewer.DisplayFrame (nCpt)
		IF oImaging.PdfAddImageFromImageID(oGdViewer.GetNativeImage) <> 0
			nImageCount = nImageCount + 1
		ENDIF
	ENDFOR
	oGdViewer.CloseImage

	FOR nCpt = 1 TO nImageCount
		oImaging.PdfSetPageDimensions(oImaging.PdfGetImageWidth(nCpt), oImaging.PdfGetImageHeight(nCpt))
		oImaging.PdfNewPage
		oImaging.PdfDrawImage(nCpt, 1, 1, oImaging.PdfGetImageWidth(nCpt), oImaging.PdfGetImageHeight(nCpt))
		oImaging.PdfEndPage
	ENDFOR

	oImaging.PdfSavePdf
ENDPROC
The oImaging and oGdViewer objects are initialized elsewhere. The OCX is correctly registered. The PDF DLL is correctly placed in C:\WINDOWS\SYSTEM32\. The application that this code resides in primary function is to capture documents from TWAIN and save them as PDFs. That works fine. The append function does not. Again, this all works fine on my development machine, no errors at all. Any suggestion you could offer would be appreciated.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Strange OLE Error

Post by Loïc » Thu Apr 17, 2008 3:06 pm

Hi,

I had never seen this error.
Could you identify the line of the code wich raise this message box ?

Best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests