Print Page | Close Window

C++ Builder 6 and Quick PDF Lite

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1867
Printed Date: 03 May 24 at 10:54PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: C++ Builder 6 and Quick PDF Lite
Posted By: graphman
Subject: C++ Builder 6 and Quick PDF Lite
Date Posted: 22 Jun 11 at 9:17PM
How to install and use it in C++ Builder 6.

Thanks.



Replies:
Posted By: Ingo
Date Posted: 23 Jun 11 at 9:22AM
Hi!
 
There is a Delphi-version (dcu), a dll and an activeX-version.
In your case i think dll or (better) activeX you should use.
How to use a dll in C++ Builder you'll know by your own.
All other stuff you'll find here:
http://www.quickpdf.org/ - http://www.quickpdf.org/
 
Cheers and welcome here,
Ingo


Posted By: AndrewC
Date Posted: 01 Jul 11 at 2:35PM
QPL works perfectly fine in BCB6.  

Copy the QuickPDFDLL0725.cpp and .h file from the \QuickPDF\DLL\Import\CPlusPlus directory into you project directory.  Also copy the QuickPDFDLL0725.DLL file to C:\WINDOWS\SYSTEM32 on 32bit or C:\Windows\SysWOW64 on 64 bit Windows or into the project directory where the compiled EXE file will reside.

// In your include section ...
#include "quickpdfdll0725.cpp"   // Note this is the CPP file.

QuickPDFDLL0725  QP("quickpdfdll0725.dll");   // A global.

#include <string>
using namespace std;

__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    int InstanceID;
    string s = "<put your key here>";

    if (QP.UnlockKey(s) != 1)
        MessageBox(Handle, "QPL License Key not valid", "Warning", MB_OK);

}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    int ret = QP.LoadFromFile("Quick.pdf");
    ... 

Enjoy,

Andrew



Posted By: AndrewC
Date Posted: 09 Jul 11 at 12:37PM
I didn't realise that you wanted to use the Lite version.

The Lite version only comes as an ActiveX control.  So you will need modify the project to use the QuickPDFLite0725.cpp and .h files.

You will also need to make sure the Active DLL is registered in windows with regsvr32.

The constructor for QuickPDFList0725 does not need the DLL name as a parameter.

With these few small changes it should work correctly.  Let us know if you cannot get it working.

It should be something like this

// In your include section ...
#include "QuickPDFLite0725.cpp"   // Note this is the CPP file.

QuickPDFLite0725  QP;   // A global.

#include <string>
using namespace std;

__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
    int InstanceID;
    string s = "<put your key here>";

    if (QP.UnlockKey(s) != 1)
        MessageBox(Handle, "QPL License Key not valid", "Warning", MB_OK);

}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    int ret = QP.LoadFromFile("Quick.pdf");
    ... 

Andrew. 


Posted By: Oliver
Date Posted: 02 Jun 13 at 3:50AM
I have tried those steps with version 9.14 with C++ Builder 6, but I get:

"Could not find a match for 'DebenuPDFLibraryDLL0914::DebenuPDFLibraryDLL0914(char *)'"

on the following line in my code:
DebenuPDFLibraryDLL0914 QP ("DebenuPDFLibraryDLL0914.dll");

From what I can tell by looking at the constructor, it needs a wstring type as a parameter. Not sure how to create a wstring.

Thanks

Oliver


Posted By: Oliver
Date Posted: 03 Jun 13 at 1:06AM
I finally figured this out on my own. Changing my code to this:
DebenuPDFLibraryDLL0914 QP (L"DebenuPDFLibraryDLL0914.dll");
worked (added 'L' before the string).

Oliver

PS: The "Getting started" for DLLs that is installed with version 9.14 is incorrect. It still references an InstanceID and all the function names start with "DPL" which also seems incorrect.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk