deathaxe
September 9th, 2007, 03:41 AM
Hello guys,
I need PDF ability in my application in order to display help information. As I like Foxit Reader very much for its speed I wanted to use it in my application too.
I am using Borland C++ Builder 6. Using the "Import ActiveX" function from its main menu I installed the foxitreader activex control as a package. When adding the new component to a TForm object it is shown correctly, but as soon as I try to call OpenFile(...) from the source code, the operation fails with an access violation.
I compared the examples for foxit's api with the imported library code. Doing so I realized the following:
While strings in api examples are ANSI, Borland C++ Builder's import library uses UNICODE parameters.
May this be the reason?
Can anybody help me with this problem, pleeaaase?
My using code is:
Boolean TAlertHelp::OpenPdf(TWinControl* AOwner, const WideString& HelpFile)
{
...
FPdf = new TPdf(AOwner);
FPdf->Align = alClient;
FPdf->Parent = AOwner;
FPdf->Visible = True;
#ifdef ACROBAT_PDF
FPdf->src = HelpFile;
FPdf->setShowToolbar(False);
#else
FPdf->OpenFile(HelpFile, L""); // this is the crash causing line
FPdf->ShowTitleBar(False);
FPdf->ShowToolBar(False);
#endif
...
}
I need PDF ability in my application in order to display help information. As I like Foxit Reader very much for its speed I wanted to use it in my application too.
I am using Borland C++ Builder 6. Using the "Import ActiveX" function from its main menu I installed the foxitreader activex control as a package. When adding the new component to a TForm object it is shown correctly, but as soon as I try to call OpenFile(...) from the source code, the operation fails with an access violation.
I compared the examples for foxit's api with the imported library code. Doing so I realized the following:
While strings in api examples are ANSI, Borland C++ Builder's import library uses UNICODE parameters.
May this be the reason?
Can anybody help me with this problem, pleeaaase?
My using code is:
Boolean TAlertHelp::OpenPdf(TWinControl* AOwner, const WideString& HelpFile)
{
...
FPdf = new TPdf(AOwner);
FPdf->Align = alClient;
FPdf->Parent = AOwner;
FPdf->Visible = True;
#ifdef ACROBAT_PDF
FPdf->src = HelpFile;
FPdf->setShowToolbar(False);
#else
FPdf->OpenFile(HelpFile, L""); // this is the crash causing line
FPdf->ShowTitleBar(False);
FPdf->ShowToolBar(False);
#endif
...
}