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!
![]() |
LIB edition DllMain |
Post Reply ![]() |
Author | |
maureen ![]() Beginner ![]() Joined: 21 Jul 11 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 21 Jul 11 at 5:34PM |
What is the full, correct syntax for calling the QUICKPDFLIBXXXX_DllMain() function when using the LIB edition of QPL? Specifically, what should the first parameter be?
I am trying to link the LIB into a C++ DLL which is then called by an EXE. I have tried QUICKPDFLIB0726_DllMain(GetModuleHandle(NULL), DLL_PROCESS_ATTACH, NULL) as per the Getting Started guide, which will pass a handle to the EXE. I have also tried passing the handle to my DLL, which I get as the first parameter to my DLL's DllMain(). Both cause QUICKPDFLIB0726_DllMain() to crash. Can anyone offer a suggestion? Thanks very much in advance. |
|
![]() |
|
maureen ![]() Beginner ![]() Joined: 21 Jul 11 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Additional information...
Linking the LIB straight into an EXE and initialising it with QUICKPDFLIB0726_DllMain(GetModuleHandle(NULL), DLL_PROCESS_ATTACH, NULL) works just fine. When I produce a release build of my DLL and EXE and run the EXE, it crashes and shows the Windows "this program has crashed" message, followed by a message box that says "Runtime Error 217 at 1001B6D1". This is the same for any handle value I pass. Again, many thanks in advance for any suggestions. |
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
The LIB file that we supply is created with a 3rd party tool that takes a DLL and makes a LIB file from it so it probably uses some tricks which are getting in the way of allowing us to add the LIB file to a DLL. As you know, QPL is complied in Delphi. Delphi creates a different object file format to MSVC (COFF vs OMF) and so the tool we use does some fancy tricks in order to create a LIB file that is compatible with the Microsoft compilers and their require LIB format. We are contacting the tool supplier for an answer. |
|
![]() |
|
Ingo ![]() Moderator Group ![]() ![]() Joined: 29 Oct 05 Status: Offline Points: 3529 |
![]() ![]() ![]() ![]() ![]() |
Hi Andrew!
Off topc but ... "... The LIB file that we supply is created with a 3rd party tool ..." Which is the name of these 3rd party tool? Would be very interesting for me. Thanks in advance. Cheers, Ingo |
|
![]() |
|
tfrost ![]() Senior Member ![]() Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
![]() ![]() ![]() ![]() ![]() |
In your own DLL, where have you put the call to load the QuickPDF DLL? You must not do this in your main DLL entry point, because you are not allowed to recursively load another DLL at this time. You may need to make another initialization call to the DLL from your main program, after your own DLL load is complete, to get your DLL to load the QuickPDF DLL. You should also be careful not to unload the DLL from a thread or process detach case in your DLL main entry.
|
|
![]() |
|
maureen ![]() Beginner ![]() Joined: 21 Jul 11 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Hi tfrost, thanks for the suggestion but unfortunately that's not the problem. The only thing I do in my DllMain() is save the HINSTANCE first parameter to a global variable.
|
|
![]() |
|
AndrewC ![]() Moderator Group ![]() ![]() Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
![]() ![]() ![]() ![]() ![]() |
![]() |
|
maureen ![]() Beginner ![]() Joined: 21 Jul 11 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() |
Well, I feel rather foolish. The problem was caused by not including the resource files QuickPDFCMap.res, QuickPDFDingbats.res and QuickPDFGlyphList.res as is quite clearly stated in the Getting Started guide.
For reference, if you're linking the Quick PDF LIB into a DLL, the correct HINSTANCE value to pass as the first parameter to QUICKPDFLIBXXXX_DllMain() is the HINSTANCE of your DLL, which you get passed by Windows as the first parameter of your own DllMain(). |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store