VB.net and ActiveX component

Posted by: sjmcom on 16 September 2017, 8:26 am EST

    • Post Options:
    • Link

    Posted 16 September 2017, 8:26 am EST

    I have been using VB6 for a long time. I am now exploring Visual Basic.NET Express 2010. Is it possible to use Component One ActiveX with VB.NET 2010 Express? If so, how? I tried Project>Add Reference>COM and selected ComponentOne VSPrinter. It loads. However, I do not see the component in the Toolbox. Any help will be appriciated.

    sm

  • Posted 16 September 2017, 8:26 am EST

    Okay, I figured this out. I added VSPrinter to Toolbox after right clicking in Toolbox area and clicking on Choose Items.. However, now when I add VSPrinter control to a form, I get following warning:

    "A reference was created to embedded interop assembly 'stdole' because of an indirect reference to that assembly from assembly 'AxInterop.VSPrinter8Lib'. Consider changing the 'Embed Interop Types' property on either assembly"

    VSPrinter code runs but does not appear to do anything.

    sm

  • Posted 16 September 2017, 8:26 am EST

    Hello Sm,

    The VsPrinter 8.0 works correctly in VB.Net 2010 Express. Please refer to the attached sample.

    We have tested the issue with VsPrinter build 8.0.20111.161 and in WinXP (32-Bit) + VB.Net 2010Express.

    Could you please check with the above mentioned build? You can download the build from the following url :

    http://prerelease.componentone.com/activex/VSView/2011-T1/vsview8_8.0.20111.161.zip

    Also, please spcify your environment details.

    Thanks,

    Richa

    2011/06/Sample_VsPrinter.zip

  • Posted 16 September 2017, 8:26 am EST

    Richa,

    It worked! I had given up on this. Thank you.

    However, I have a new issue. I copied all new ocx and dll file to C:WindowsSysWOW64 folder where old files were (I am using 64 bit Windows). Now when I start the program, I am getting Component One license warning saying this is an evaluation version.

    SM

  • Posted 16 September 2017, 8:26 am EST

    Hello Sm,

    Your license might not be valid for this build and you would need to upgrade your licenses.

    Please contact our Sales for this :

    ComponentOne Sales

    Phone Nos : 800.858.2739, 412.681.4343

    Fax : 412.681.4384

    Email : sales@componentone.com

    Thanks,

    Richa

  • Posted 16 October 2017, 11:39 pm EST

    Hi,

    While saving VSPrinter Doc in PDF format using VSPDF component, I am getting below error:

    Exception thrown: ‘System.Runtime.InteropServices.COMException’ in AxInterop.VSPDF8Lib.dll

    AxInterop.VSPDF8Lib.dll The object is not a VSPrinter 8.0 control.

    Please let me what is the issue?

    Thanks,

    Alok

  • Posted 22 October 2017, 10:31 pm EST

    Hi Alok,

    Are the ocx files properly registered on your machine? Please try registering them manually using regsvr32 utility and see if the problem persists.

    If it does, please share a stripped down project demonstrating the behavior along with the build version of VSView 8.0 you are currently working with.

    Thanks,

    Pragati

  • Posted 23 October 2017, 12:29 am EST

    Hi Pragati,

    I am using vsview8 version 8.0.20111.162.

    I have downloaded it from http://prerelease.componentone.com/activex/VSView/2011-T1/vsview8_8.0.20111.161.zip.

    I have properly registered using below command:

    regsvr32 vsdraw8.ocx

    regsvr32 vspdf8.ocx

    regsvr32 vsppgvp8.dll

    regsvr32 vsprint8.ocx

    regsvr32 vsvport8.ocx

    I have vsprinter ocx on VS2015 VB.net form. I generate report in preview mode through code.

    I tried to save the vsprinter preview document in pdf format using VSPdf8 ocx with same version.

    Code is below:

    If ls_FileName <> “” Then

    Call objPDFConverter.ConvertDocument(obj_VSPreview, ls_FileName)

    End If

    It throws below error:

    Exception thrown: ‘System.Runtime.InteropServices.COMException’ in AxInterop.VSPDF8Lib.dll

    AxInterop.VSPDF8Lib.dll The object is not a VSPrinter 8.0 control.

  • Posted 26 October 2017, 9:54 pm EST

    Hi Alok!

    This issue could be replicated at our end also. So, we have escalated this to the concerned team and will inform you once it is fixed [Tracking ID : 294079].

    Regards,

    Meenakshi

  • Posted 13 November 2017, 12:17 am EST

    Hi Meenakshi,

    What is the status of Tracking ID: 294079. Any updates on this issue?

    Thanks,

    Alok

  • Posted 13 November 2017, 7:32 pm EST

    Hi Alok,

    The issue is currently with the developers. I have asked them for an update on this and will let you know once there is any information from them.

    Thanks,

    Pragati

  • Posted 19 November 2017, 9:19 pm EST

    Hi Alok,

    In .NET, the programmer does not reference ActiveX controls directly, it creates wrappers. The ConvertDocument call is looking for the actual ActiveX control and not the wrapper, so it is necessary to get the raw OCX from the VSPreview control wrapper by calling the GetOcx() method. In the sample case:

        Dim ls_FileName As String = "../../Sample.pdf"
        If ls_FileName <> "" Then
            Call objPDFConverter.ConvertDocument(obj_VSPreview.GetOcx(), ls_FileName)
        End If
    

    This behavior is common for the handling of several objects. At times you may even find the calling method should be made from the OCX rather than the wrapper and you may need API calls.

    Thanks,

    Pragati

  • Posted 18 December 2017, 11:35 pm EST

    Hi Pragati,

    Thankyou for this information. It worked for me as well.

    Thanks

    Alok

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels