Print Page | Close Window

Active X Error

Printed From:
Category: PDF reDirect
Forum Name: Programming
Forum Discription: VBA and Batch Tools to control PDF reDirect Pro
Printed Date: 30 Mar 23 at 4:35PM

Topic: Active X Error
Posted By: JackR
Subject: Active X Error
Date Posted: 19 Jan 09 at 1:18PM
I copied an application that I created with the Active X dll to a new PC. The application was originally created on an XP PC. The new one is a Vista PC. PDF ReDirect Pro is installed and working properly. The BatchBdf printer is installed. I tried installing version and of the Active X Tool. I received the same error message as listed below
Cannot create Active X component.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Exception: Cannot create ActiveX component.
   at Microsoft.VisualBasic.Interaction.CreateObject(String ProgId, String ServerName)
   at WindowsApplication1.Form1.Button2_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
    Assembly Version:
    Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
    Assembly Version:
    Win32 Version:
    CodeBase: file:///C:/Users/Jack/Desktop/WindowsApplication3.exe
    Assembly Version:
    Win32 Version: 8.0.50727.1434 (REDBITS.050727-1400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/
    Assembly Version:
    Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/
    Assembly Version:
    Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/
    Assembly Version:
    Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/
    Assembly Version:
    Win32 Version: 2.0.50727.1434 (REDBITS.050727-1400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the section.
The application must also be compiled with debugging

For example:

    < jitDebugging="true" />

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Posted By: Michel_K17
Date Posted: 20 Jan 09 at 2:01AM

   This is odd, indeed. I have tested the component on Vista, so it should work.

   Have you tried running the (unmodified) sample VBA code? Do you get the same error? Your own code: what language are you using? .NET?

   best regards,

Michel Korwin-Szymanowski
EXP Systems LLC

Posted By: JackR
Date Posted: 20 Jan 09 at 11:16PM
The program is written in VB8 Express

The error is created when the program hits pdf = CreateObject("PDFR_PRO_Batch_RC.PDF_reDirect_Pro_Tool")

Dim pdf

        pdf = CreateObject("PDFR_PRO_Batch_RC.PDF_reDirect_Pro_Tool")

        Dim TempBool As Boolean

        TempBool = pdf.Batch_Printer_Load_Settings("BatchPDF")
        TempBool = pdf.Settings_Picture_Quality = 1

        pdf.settings_Master_Password = TextBox1.Text
        pdf.Settings_FileType = 1
        pdf.Settings_Encrypt_Password = TextBox2.Text
        pdf.settings_Stamps = ""

Posted By: Michel_K17
Date Posted: 22 Jan 09 at 12:06AM

When you created your project, did you create a link to the ActiveX component (ie did you set a reference)? If not, it should still work if the component is registered, which should have occurred during the installation. Nonetheless, you can try to re-run Regsvr32 to make sure.

I hope that helps,

Michel Korwin-Szymanowski
EXP Systems LLC

Posted By: JackR
Date Posted: 22 Jan 09 at 11:54PM
Hi Michel

I believe the component is registered but I tried to rerun Regsvr32. I kept on recieving an error message that stated that the module failed to load. Make sure the binary is stored at the specified path.
Which file am I running Regsrv32 on?

Posted By: Michel_K17
Date Posted: 23 Jan 09 at 10:56AM
Hello Jack,

The ActiveX component is called: ActiveX_PDF_Pro.dll

Yes, you must specify that file for the registration to work. If your Command line is not in the PDF reDirect folder, you have to enter the entire path.

To unregister, use the "/u" switch. No switch required to register.

So, at this stage, I would first confirm that the file is installed, registered, and that the demo code works OK before trying your code.

I hope this works for you.


Michel Korwin-Szymanowski
EXP Systems LLC

Posted By: JackR
Date Posted: 23 Jan 09 at 9:46PM
Hi Michel

The dll was registerd and it the program is still not working. I am thinking that it may be a permission issue related to vista. Also, the new system is 64bit vs 32 bit. I am not a programmer. This may be a simple fix. I spent a lot of time last year writing the program. I hope that I can get it to work on my new computer. Thank you for your help.


Posted By: JackR
Date Posted: 24 Jan 09 at 10:50AM
Hi Michel

I figured out the problem. Thank you again for you help
See below:

VB Express Editions:
The VB and C# Express products do not expose the Target property inside the development environment. You will need to carefully modify the project file using a
text or XML editor.
1. Close the project and/or solution
2. Select Open File from the File menu
3. Navigate to the project directory, and highlight the project file
4. Press the Open button, the project file should open in the XML editor
5. Locate the first <PropertyGroup> section and add the following line:
1. Save the project file
2. Reopen the project and/or solution using Open Project/Solution from the File menu
3. Continue with development, debugging, and testing
Alternatively, if the application is targeted to 64-bit platforms, you can ensure that the COM controls added to the application have 64-bit equivalents on the
development and deployment computers.
Issues When Using Microsoft Visual Studio 2005

Posted By: Michel_K17
Date Posted: 24 Jan 09 at 10:03PM

   Thanks for the update, and providing the solution which will help others. I'm still using VS2005, and have not played with the Express editions. Well done!

   Best regards,

Michel Korwin-Szymanowski
EXP Systems LLC

Posted By: Stellina99
Date Posted: 05 Feb 09 at 12:55AM
The information provided by you is very useful for me. Thanks for the information. I would like to know more about it.

Snoreta - New Jobs

Print Page | Close Window