Print Page | Close Window

CreateObject("QuickPDFAX0723.PDFLibrary") fails

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=2538
Printed Date: 29 Jun 24 at 2:04AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: CreateObject("QuickPDFAX0723.PDFLibrary") fails
Posted By: DanH
Subject: CreateObject("QuickPDFAX0723.PDFLibrary") fails
Date Posted: 23 Feb 13 at 5:03PM
I'm working on a VB.NET application (Visual Studio 2010) and am having problems creating the QPDF object.  I'm using the following code:

Dim qp As QuickPDFAX0723.PDFLibrary
qp = CreateObject("QuickPDFAX0723.PDFLibrary")

The above raises a "Cannot create ActiveX object".  I've tried registering Interop.QuickPDFAX0723.dll on my system but to no avail.  I'm on Windows 7 (64 bit).  I've set the target platform in my project to x86 and tried running regsvr32.exe both from the System32 and Syswow64 directories and each time I'm given the error "The module Interop.QuickPDFAX0723.dll was loaded but the entry point DllRegisterServer was not found.  Make sure that Interop.QuickPDFAX0723.dll is a valid DLL or OCX file and then try again."

If I change the code to the following:

Dim qp As New QuickPDFAX0723.PDFLibrary

I get the following error:

"System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {5530475D-F0A2-41BF-AA94-72FA0779289D} failed due to the following error: 80040154."

I can't find the CLSID in the registry. 

Can't get past this problem...




Replies:
Posted By: darkv
Date Posted: 23 Feb 13 at 11:29PM
Dan,

can you try the following

dim qp as pdflibrary
qp=new pdflibrary("path to you quickpdflib.dll")

It works perfect for me, in the same context

Rgds
Eric


Posted By: DanH
Date Posted: 23 Feb 13 at 11:48PM
The following line is fine as long as I have "Imports QuickPDFAX0723":

dim qp as pdflibrary 'accepts this if I add

But it won't compile with the following line. It getsthe error "Too many arguments to 'Public Sub New()':

qp=new pdflibrary("path to you quickpdflib.dll")

If I change the above to just "qp=new pdflibrary()" then it compiles fine but still gets the run time error "Retrieving the COM class factory for component with CLSID {5530475D-F0A2-41BF-AA94-72FA0779289D} failed due to the following error: 80040154."




Posted By: darkv
Date Posted: 25 Feb 13 at 7:52AM
Dan,

Sorry about forgot the imports line.

I'm very surprized, i used this for a while and it works perfectly
(even when running the exec on a computer which just have the dll and nothing registered)

can you try to store the dll path in a string, and call new pdflibrary(string_where_you_stored_path)

Which .net framework do you compile with?

Rgds
Eric


Posted By: DanH
Date Posted: 26 Feb 13 at 3:27AM
Originally posted by darkv darkv wrote:

Dan,

Sorry about forgot the imports line.

I'm very surprized, i used this for a while and it works perfectly
(even when running the exec on a computer which just have the dll and nothing registered)

can you try to store the dll path in a string, and call new pdflibrary(string_where_you_stored_path)

Which .net framework do you compile with?


If the class' New() method doesn't take an argument, then placing the string in a variable and passing it won't solve the problem. 

I'm using the ActiveX version.  Maybe you're using the DLL version and that's why it works differently for your code.

I'm targeting 2.0 of the .NET framework.


Posted By: DanH
Date Posted: 26 Feb 13 at 3:28AM
By the way, I'm working with version 7.23 of QuickPDF.  If you're on a different version then that might also explain the difference.


Posted By: darkv
Date Posted: 26 Feb 13 at 7:20AM
Dan,

You're right i'm using the dll version, 7.26

Eric



-------------
z Dark side is there ...


Posted By: DanH
Date Posted: 01 Mar 13 at 3:34AM
Anyone else have any ideas?  I'm still stumped here...


Posted By: AndrewC
Date Posted: 03 Mar 13 at 7:37AM
1. You need to have the 'imports QuickPDFAX0723"' line in the code.

2. With the ActiveX version you don't need to specify DLL name as the CLSID is already in the QuickPDFAX0723.vb file.

3. The 80040154 is a very common error and usually happens when the ActiveX has not been registered correctly.  regsvr32 needs to be run using an Administrator account.

The QuickPDFAX0723.DLL should not be added to your project as a reference.  Only the QuickPDFAX0723.vb file should be added as a reference.  The ActiveX is a standard OCX type DLL and not a .NET DLL.

There should not be any differences between 7.23 and 7.26 in respect to getting the ActiveX registered and running in your application.

Here is some VB.NET code for QPL 8.14 which again is not much different.  The QuickPDFAX0814.vb is added to the project as a reference.  The platform is set to x86 and I am using .NET 4.0.

Andrew

/-----------------------------------------------------------------------------------------

Imports QPL_VB_ActiveX_Sample.QuickPDFAX0814

Public Class Form1

    Dim QuickPDF As PDFLibrary
    Dim Result As Integer


    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

        QuickPDF = New PDFLibrary()

        Result = QuickPDF.UnlockKey("<insert your license key here>")

        MessageBox.Show(Result)

    End Sub
End Class

/-----------------------------------------------------------------------------------------


Andrew.


Posted By: DanH
Date Posted: 03 Mar 13 at 5:41PM
Originally posted by AndrewC AndrewC wrote:

1. You need to have the 'imports QuickPDFAX0723"' line in the code.

2. With the ActiveX version you don't need to specify DLL name as the CLSID is already in the QuickPDFAX0723.vb file.

3. The 80040154 is a very common error and usually happens when the ActiveX has not been registered correctly.  regsvr32 needs to be run using an Administrator account.

The QuickPDFAX0723.DLL should not be added to your project as a reference.  Only the QuickPDFAX0723.vb file should be added as a reference.  The ActiveX is a standard OCX type DLL and not a .NET DLL.

Andrew


Thanks for your response Andrew.  But I don't have a QuickPDFAX0723.vb in my project.  This is a project that was handed over to me over a year ago.  At the time I was able to load and run the project with no problems.  I'm on a different computer now and am having the problems mentioned in the original post.

I think that the key point of my problem touched on when you said "
The 80040154 is a very common error and usually happens when the ActiveX has not been registered correctly.  regsvr32 needs to be run using an Administrator account."  I'm sure that if I could register the Interop.QuickPDFAX0723.dll file that would be the end of my problem.  But I can't and have no idea why I can't...



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