Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Using QuickPDF in Multi-Thread app
  FAQ FAQ  Forum Search   Register Register  Login Login

Using QuickPDF in Multi-Thread app

 Post Reply Post Reply
Author
Message
RedOctober2018 View Drop Down
Team Player
Team Player
Avatar

Joined: 22 Jun 18
Location: West
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedOctober2018 Quote  Post ReplyReply Direct Link To This Post Topic: Using QuickPDF in Multi-Thread app
    Posted: 04 Jul 21 at 10:45PM
Platform: Windows 2016 Server  Lazarus 2.0.10, FreePascal 3.2.0
Web App:  Brook 5 Framework  QuickPDF Library 10.13
Uses clause contains:  ComObj, ActiveX,  DebenuPDFLibrary64AX1013_10_13_TLB;                           

I need use the QuickPDF library in a non-main thread of my web app.  However, when I run the code to create a library object:

...
var
   qpdfDCL: TAxcPDFLibrary;
begin
    qpdfDCL := TAxcPDFLibrary.Create(frmMain);
...


I always get this error message:
  CheckSynchronize called from non-main thread

What is the correct, thread-safe way, to .Create, use and .Free, the QuickPDFLibrary in a non-main thread?

Thanks in advance.


Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 04 Jul 21 at 10:50PM
Hi,

think this haven't to do with QuickPDF itself.
Try Google with CheckSynchronize...
Think you'll get the solution of your issue in the www ;-)



Edited by Ingo - 04 Jul 21 at 10:51PM
Cheers,
Ingo

Back to Top
RedOctober2018 View Drop Down
Team Player
Team Player
Avatar

Joined: 22 Jun 18
Location: West
Status: Offline
Points: 25
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedOctober2018 Quote  Post ReplyReply Direct Link To This Post Posted: 04 Jul 21 at 11:22PM
Hi Ingo, Yes,  I researched this problem and found CoInitialize and CoUnitialize, but no matter where I call these in relation to the call to create a QuickPDFLibrary object, I get an error message.  I suspect there is a call to CheckSynchronize inside the QuickPDFLibrary which means it always needs to be in the main thread.  But it can't be, because I'm using QPDF Lib in the non-main thread.

CoInitialize must be called within the non-main thread.  UnCoInitialize must not be called in the non-main thread, it must be called in the main thread.

That's why I just asked the open ended question  "what is the correct way to do this" which usually elicits a broader and more complete answer than asking a more narrowly focused question.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jul 21 at 10:51PM
Hi,

i've made a complete scan through all source elements of version 18.11 ...
There isn't a single Synchronize... Nothing.
CoInitialize i've found - but i didn't found UnCoInitialize.
 



Edited by Ingo - 05 Jul 21 at 10:54PM
Cheers,
Ingo

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store