Results 1 to 5 of 5

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

  1. #1
    Join Date
    Sep 2006
    Posts
    20
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question QAxWidget, How to close Acrobat pdf Reader AcroRd32.exe - the process who survives.

    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.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QAxWidget, How to close Acrobat pdf Reader AcroRd32.exe - the process who survive

    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?
    J-P Nurmi

  3. #3
    Join Date
    Sep 2006
    Posts
    20
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QAxWidget, How to close Acrobat pdf Reader AcroRd32.exe - the process who survive

    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.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QAxWidget, How to close Acrobat pdf Reader AcroRd32.exe - the process who survive

    Btw, this works for me:
    Qt Code:
    1. #include <QtGui>
    2. #include <ActiveQt>
    3. #include "acropdf.h"
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc, argv);
    8. QString file = QFileDialog::getOpenFileName();
    9. if (file.isNull())
    10. return 0;
    11.  
    12. AcroPDFLib::AcroPDF pdf;
    13. pdf.LoadFile(file);
    14. pdf.show();
    15. return app.exec();
    16. }
    To copy to clipboard, switch view to plain text mode 
    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.
    J-P Nurmi

  5. #5
    Join Date
    Jun 2012
    Location
    India
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QAxWidget, How to close Acrobat pdf Reader AcroRd32.exe - the process who survive

    In the Destructor:

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

    Hope this helps...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.