gamease


Hi,

I get the error :OLE error code 0x80040154. Class is not registered. OLE Object is being ignored. I get this error when i run a form which has a pdf document in VFP 6.0.

If my computer has only installed the acrobat reader with version 6.0 or before, there will be no error occured. But when my computer has installed the acrobat reader with version 7.0 or later. The error will appear.

Can somebody help I really need the answer as soon as possible, thanks.

gamease





Re: OLE object error

dni

You may need to register a dll or a ocx file used by form, with RegServ32.exe.







Re: OLE object error

gamease

DNI

Can you tell me how to use the regserv32.exe to register a dll or a ocx file
Thanks

gamease




Re: OLE object error

Alex Feldstein

Simply:

regsvr32 myfile.dll

If you open a DOS window: Start->Run-> type "cmd" (without quotes)

and then you type Regsvr32 and press Enter you will get a help form indicating the usage to register/unregister DLLs





Re: OLE object error

gamease

But how can I solve the error
I still don't really understand
Can someone help me
Thanks

gamease




Re: OLE object error

dni

Did you try to register dll or ocx






Re: OLE object error

gamease

I am sorry, can you explain to me what dll or ocx needed to be installed for viewing pdf documents
Would you mind showing me a full step for registering it because I am not too familiar with register, thanks a lot.

gamease





Re: OLE object error

Naomi Nosonovsky

What code or Ole control are you using to view PDFs documents If you're using the one that ships with Adobe, better forget it. There were numerious threads on this problem on UT (another VFP forum) and the general consensus is to not use this viewer but better use WebBrowser control. That's why I posted a link in my first message to

http://www.berezniker.com/display/VFP/View+PDF+in+VFP+Form

It should explain what do you need to do to use it.

More information about this code is currently in the comment, e.g.

1. Drop olecontrol on the form and pick Microsoft Web Browser
2. Change its name to oWB
3. Drop a command button on the form and copy code from command1.Click into its click method.
4. In VFP8 and earlier put NODEFAULT into REFRESH() event to prevent an error.

The methods shown there such as ShowPDF you should add to your form. Go to Menu Form\NewMethod and type ShowPDF, you would put the code from the referenced link in this method.

Hope this helps.





Re: OLE object error

dni

I don't know what you are using, but on your form you shoud have a ActiveX Bound Control or OLE control or in your procedures or a declared dll. All are binded to files. That file with extension ocx or dll may need to be registered as explanation or your error.






Re: OLE object error

CraigBoyd

Give the Microsoft Web Browser control a try. For an example, take the following code and paste it into a prg file and then execute it. Click the Open PDF button and locate a PDF file you would like to view.

Code Snippet

PUBLIC oform1

oform1=NEWOBJECT("form1")

oform1.Show

RETURN

DEFINE CLASS form1 AS form

DoCreate = .T.

Caption = "Form1"

Name = "Form1"

ADD OBJECT command1 AS commandbutton WITH ;

Top = 216, ;

Left = 276, ;

Height = 27, ;

Width = 84, ;

Anchor = 12, ;

Caption = "Open PDF", ;

Name = "Command1"

ADD OBJECT olecontrol1 AS olecontrol WITH ;

Top = 0, ;

Left = 0, ;

Height = 205, ;

Width = 376, ;

Anchor = 15, ;

Name = "Olecontrol1", ;

OleClass = "Shell.Explorer.2"

PROCEDURE command1.Click

LOCAL lcFileName

m.lcFileName = GETFILE("PDF","Select PDF File","Select")

IF FILE(m.lcFileName)

thisform.olecontrol1.navigate("file:///" + m.lcFileName)

endif

ENDPROC

ENDDEFINE






Re: OLE object error

gamease

Your above program code is only used in .prg file, can it be changed and used in form (.sct)file
If possible, can you change it for me, thanks

gamease




Re: OLE object error

Naomi Nosonovsky

Did you follow the link and instructions I gave you in my previous message

Thanks.