SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

sharpdevelop1.1 adding references to ocx/typelibraries/COM

Last post 03-24-2006 12:51 PM by MattWard. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-19-2006 9:29 AM

    • jsdev
    • Top 500 Contributor
    • Joined on 02-13-2006
    • Posts 12

    sharpdevelop1.1 adding references to ocx/typelibraries/COM

    Hi,
    I am using SharpDevelop1.1 for VB.Net development.

    .NET Version         : 1.1.4322.573
    OS Version           : Microsoft Windows NT 5.1.2600.0
    Boot Mode            : Normal
    Working Set Memory   : 114364kb
    SharpDevelop Version : 1.1.2118.0

    I want to include the MS Access 2000 type library so as to be able to create an Access Object and use it from VB.Net. In general, from the Assembly Scout, one gets the impression that merely by selecting the correct COM/ActiveX file (either OCX or TypeLib or Library) we can use it directly in SharpDevelop. However, we need to import using aximp.exe(for ActiveX control) or tlbimp.exe(for Type Library).
    For ocx's I tried aximp, it was successfully converted and showed up in the assembly scout. The ocx I tried was MSCAL.ocx which showed up as AxMSACAL in the Assembly scout.
    For tlb, I trieb msado27.tlb, again it was successfully converted and showed up in Assembly scout as ADODB.
    However, neither showed up in the Tools Pad which lists the common WindowsForms controls (even in Custom Components neither showed up).
    In the code I tried the following:

    Imports AxMSACAL
    Imports ADODB
    .....
    Dim cal As New AxMSACAL.AxCalendar()
    Dim adoObj as New ADODB.Connection()

    But neither is recognised by the complier. I get the messages:

    ------ Build started: Project: WinHello Configuration: Debug ------
    Performing main compilation...
    C:\data\projects\SharpDevelop\WinHello\Form2.vb(17) : error BC30466: Namespace or type 'ADODB' for the Imports 'ADODB' cannot be found.
    Imports ADODB
            ~~~~~
    C:\data\projects\SharpDevelop\WinHello\Form2.vb(18) : error BC30466: Namespace or type 'AxMSACAL' for the Imports 'AxMSACAL' cannot be found.
    Imports AxMSACAL
            ~~~~~~~~
    C:\data\projects\SharpDevelop\WinHello\Form2.vb(316) : error BC30002: Type 'AxMSACAL.AxCalendar' is not defined.
                Dim cal As New AxMSACAL.AxCalendar()
                               ~~~~~~~~~~~~~~~~~~~  
    C:\data\projects\SharpDevelop\WinHello\Form2.vb(318) : error BC30002: Type 'ADODB.Connection' is not defined.
                Dim adoobj As New ADODB.Connection()
                                  ~~~~~~~~~~~~~~~~  

    Which step am I possibly missing?

    Is there any setting in Tools->Options that I am missing?

    This might sound dumb, but  does SharpDevelop 1.1 have a "Tool Scout" .... because I couldnt find it any where the only thing I found to add assemblies was Assembly scout.

    The thing is that the libraries show up in the Assembly scout with all the methods and classes but I cannot import them.

    Any help is appreciated.

    Thanks in advance,
    JS
  • 03-19-2006 12:34 PM In reply to

    Re: sharpdevelop1.1 adding references to ocx/typelibraries/COM

    From the ActiveX Import entry in the wiki, once you have generated the dlls using aximp, activate the form design window, right click on one of the Tool Scout tabs and from the drop down list choose Configure Sidebar.  Then you can browse to the generated dll, and add it to the sidebar.

    If it is a normal COM component, not an ActiveX control, you should be able to add a reference to it using the Add Reference dialog.
  • 03-24-2006 9:26 AM In reply to

    • jsdev
    • Top 500 Contributor
    • Joined on 02-13-2006
    • Posts 12

    Re: sharpdevelop1.1 adding references to ocx/typelibraries/COM

    Thanks,
    I got to the configure sidebar option (finally) and manged to have the control display on the tools scout pad, but I when I try to drag the control onto the form I get an error
    "ActiveX controls accept only fonts that are defined in GraphicsUnit.Point. Parameter name: font"
    Is there any workaround for this or does it mean that the activex controls I chose to import and test are not font-compatible and so cannot be used? If so, it means that only some of the VB6 standard controls can be imported via aximp and successfully used in SharpDevelop. Do you know of some that will work? I will try some more meanwhile and post if I manage to complete the process.

    Thanks again,
    Regards,
    JS
  • 03-24-2006 12:51 PM In reply to

    Re: sharpdevelop1.1 adding references to ocx/typelibraries/COM

    Change the Form's Font.Unit property to Point.
Page 1 of 1 (4 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.