My colleague posted about this problem some time ago, but here's a more detailed version:
In VB6, when using the PDF Converter v3.00, if we declare our PDFPrinter variable "WithEvents", we get an error 459 "Object or class does not support the set of events" as soon as we instantiate the object.
This behavior worked properly using v2.50 and prior versions of the Converter. We need the "WithEvents" to be able to call the EnablePrinter() function when the event EnabledPre() is raised, otherwise we get the dreaded error -30...
All components are installed and properly registered...
Can anyone confirm this behavior and/or recommend a workaround? T.I.A!
To reproduce this problem:
1 - Install v3.00 on a workstation NOT having any other PDF Converter version installed.
2 - Open a new, blank VB6 project.
3 - In the project's references, click 'Browse' and add "C:\Windows\System32\cdintf300.dll"
4 - Place the following code in a VB6 Form with one Command button on it, then run and click the button.
Code: Select all
Option Explicit
Private WithEvents PDFConverter As CDIntfEx.CDIntfEx
Private Sub Command1_Click()
On Error Resume Next
Set PDFConverter = New CDIntfEx.CDIntfEx ''This line generates the error 459...
If Err.Number = 0 Then
MsgBox "PDFConverter created.", vbInformation
Else
MsgBox "PDFConverter NOT created, err.Number = " & Err.Number & vbNewLine & Err.Description, vbCritical
End If
End Sub