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 - LIB edition DllMain
  FAQ FAQ  Forum Search   Register Register  Login Login

LIB edition DllMain

 Post Reply Post Reply
Author
Message
maureen View Drop Down
Beginner
Beginner


Joined: 21 Jul 11
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote maureen Quote  Post ReplyReply Direct Link To This Post Topic: LIB edition DllMain
    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.
Back to Top
maureen View Drop Down
Beginner
Beginner


Joined: 21 Jul 11
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote maureen Quote  Post ReplyReply Direct Link To This Post Posted: 21 Jul 11 at 6:49PM
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.
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 22 Jul 11 at 8:54AM
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.


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

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 22 Jul 11 at 4:08PM
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

Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 22 Jul 11 at 9:51PM
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.
Back to Top
maureen View Drop Down
Beginner
Beginner


Joined: 21 Jul 11
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote maureen Quote  Post ReplyReply Direct Link To This Post Posted: 25 Jul 11 at 12:44PM
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.
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jul 11 at 1:43PM
Back to Top
maureen View Drop Down
Beginner
Beginner


Joined: 21 Jul 11
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote maureen Quote  Post ReplyReply Direct Link To This Post Posted: 04 Aug 11 at 11:57AM
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().
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