PDA

View Full Version : QAxWidget, How to close Acrobat pdf Reader AcroRd32.exe - the process who survives.



VlJE
17th September 2007, 11:22
Hi! I load the acrobat reader 8 ActiveX Control:
ui.axWidget->setControl("{ca8a9780-280d-11cf-a24d-444553540000}");
QVariant qvRc=ui.axWidget->dynamicCall("LoadFile(const QString&)", fi.absoluteFilePath());

In the destructor:
ui.axWidget->clear();

The problem:
If I close my dialog, the process AcroRd32.exe survives and complains if I for example end my windows XP session.

jpn
17th September 2007, 12:31
Try

dumpcpp {ca8a9780-280d-11cf-a24d-444553540000} -o acropdf
and see if there's a method for cleaning up.. Oh, and does the widget get properly destructed?

VlJE
17th September 2007, 13:27
Dumpcpp works and produces .cpp and .h files, thank You.
There is nothing similar (for me) to the cleaning up method.
If I put following lines one direct after other:
ui.axWidget->dynamicCall("LoadFile(constQString&)",path);
ui.axWidget->clear();
, so I see no PDF Document in my widget, the process AcroRd32.exe remains in memory after I finish the application.

jpn
17th September 2007, 14:00
Btw, this works for me:


#include <QtGui>
#include <ActiveQt>
#include "acropdf.h"

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QString file = QFileDialog::getOpenFileName();
if (file.isNull())
return 0;

AcroPDFLib::AcroPDF pdf;
pdf.LoadFile(file);
pdf.show();
return app.exec();
}

Where acropdf.h and acropdf.cpp were generated by dumpcpp. I can see AcroRd32.exe starting up, and I can see it quitting a while after the window is closed.

shivaranjani
27th June 2012, 10:41
In the Destructor:

QProcess pPdfviewer(ui.axWidget);
pPdfviewer.kill();

Hope this helps...:cool: