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!

Adobe's PDF.OCX crashes VFP 7.0

Status
Not open for further replies.

IRABYY

Programmer
Apr 18, 2002
221
US
Hello, fellow VFP programmers!

Have anybody tried to use Adobe's PDF.OCX in VFP app? Now, the problem: I have PDF.OCX control in a form; whenever I execute the program in VFP environment and open an instance the form with this PDF.OCX, and then exit the program it crushes VFP ("VFP7 has caused an error in KRNL386.EXE etc." type of message). To add worse to the bad, it doesn't happen immediately after I exited my program and returned back to VFP, it happens only after some time lapsed (period also varies). When I run compiled EXE the error message reads different - and differs every time - but is still the same in essence.

I also noticed that the process Acrord32 is still running even after I close VFP or exit program, and it still runs even after any of those system error messages. But if I manage to Alt-Ctrl-Del and End Task on the Acrord32 process before the error occures - no crushes whatsoever.

I used the guidelines in August 2002 FoxPro Adviser issue (p. 10, "Shut Down Abandoned Applications") and wrote procedure that closes all the background windows with the word "Acrobat" in its' classes names - still the same, Acrord32 is still running and does it's "dirty trick" :)of "pitching" VFP 7.0 against Kernel :).

Have anybody run into anything like this?

Another question: have anybody ever written a procedure to close the process itself, not just a window(s) generated by this process?

Thanx!

Regards,

Ilya

PS If anybody's interested in the code of that procedure for closing the preocess' related windows - I can provide it (post it here).
 
Yes, Rick! I, indeed, have looked up Adobe's Acrobat Plug-in SDK. If I understand it correctly, it allows you to make your own plug-ins for Adobe Acrobat and says nothing about the OCX itself. This is not what I need, though. Or maybe I am missing something?

Thanks!

Regards,

Ilya
 
IRABYY

Have anybody tried to use Adobe's PDF.OCX in VFP app? Now, the problem: I have PDF.OCX control in a form; whenever I execute the program in VFP environment and open an instance the form with this PDF.OCX, and then exit the program it crushes VFP ("VFP7 has caused an error in KRNL386.EXE etc." type of message). To add worse to the bad, it doesn't happen immediately after I exited my program and returned back to VFP, it happens only after some time lapsed (period also varies). When I run compiled EXE the error message reads different - and differs every time - but is still the same in essence.

I have used Adobe Acrobat in a few apps. And pdf.ocx is not the activex that gets installed with the application. May I suggest you create an install application, and just specify the Adobe Acrobat and see what gets installed.
 
IRABYY

Assuming you want to view a .pdf in a VFP form, the control you need is the Adobe Acrobat Control for ActiveX.

This gets installed with any version of the Adobe Acrobat Viewer and should show up in the ActiveX controls list.

Drop it on a form and in the .Init() event of the form put:-

THIS.olePDFviewer.LoadFile([path\pdfname.pdf])


On my current development machine, Win2K Pro, attempting to access the control itself will cause VFP7 to crash, but you still have access to the object's PEMs as per normal.

One thing to note, if you try to have the Adobe Acrobat Viewer and a VFP viewer using the control on screen at the same time, the VFP viewer will go blank.

I use a timer on the VFP viewer which "watches" for the appearance of the Adobe Acrobat Viewer and releases the VFP viewer should it appear. HTH

Chris [pc2]
 
That's exactly what I've done, Cris! And -yes, I know about that problem with running Acrobat and VFP app. with PDF.OCX employed simultaneously.

That is not the problem, though, that I'm having. The problem is that after closing the program written in VFP the Acrord32 process is still running and it eventually gives GPF-type of error. If I run the program in VFP development environment - it reports that VFP "misbehaves", when I run the same program as compiled EXE - still GPF error with some other weird system message.

It looks like that "lingering" Acrord32 process is still trying to do something that causes this behavior.

Have anybody written something in VFP to terminate the process (not hidden windows, I've done that and it did not help)?

Regards,

Ilya
 
Ilya

What O/S are you running?

What version of VFP are you running?

There are WinAPI calls to terminate a process, would be a starting point.

I have an app that uses the .ocx as a viewer changing pdfs programatically - it runs on Win98, ME and Win2K Pro without any of the symptoms you describe.

There is some comfort in the knowledge that it can be made to work. HTH

Chris [pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top