Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE Error on displaying a PDF 2

Status
Not open for further replies.

GuitarSlayer

Programmer
Dec 16, 2004
29
GB
I have a form which uses an activeX control to display a PDF
and until recently have had no problems with it using ADOBE Acrobat 5 Reader, however some people have been having problems using this form with ADOBE Acrobat version 7. The following error is displayed when trying to run the form:-

OLE error code 0x80040154. Class is not registered. OLE object is being ignored. Record number 4.

I took it for granted that the installer in Adobe would look after registering of this sort of stuff.

Anyone got any ideas?
 
GuitarSlayer

I was able to load a document in the PDF reader activex. But it seems Adobe has change the way things work. The only way I was abble to do it was via code, loading the activex and specifying the document in the init of the form. Re the following in a prg to see how. Change the documetn name a pth to suit your needs. (This is based on the Adobe Acrobat 7.0 Browser Documetn Activex)


Code:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"
    height = 350
    width = 600
	ADD OBJECT olecontrol1 AS olecontrol WITH ;
		Top = 24, ;
		Left = 48, ;
		Height = 300, ;
		Width = 500, ;
		Name = "Olecontrol1",;
		OleClass = "AcroPDF.PDF.1"
	PROCEDURE Init
	  lcfile = "c:\program files\merak\webmail\webmail.pdf"
	  this.olecontrol1.loadfile(lcfile)
	ENDPROC
ENDDEFINE


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
GuitarSlayer

I agree with Mike's findings on this version of the ActiveX version control.

You also have the option of displaying a pdf in a webbrowser control in a VFP form, creating an instance of IE and displaying a pdf in the IE object or utilising Adobe Reader.

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommandertm.net
PDFcommandertm.co.uk
 
Chris,

Thanks for the tip with IE object completely forgot about that
I'll try that too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top