Announcement

Collapse
No announcement yet.

Which syntax to use for COM/TYPELIB?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Which syntax to use for COM/TYPELIB?

    Currently I'm tranferring some of my C++ programs to PB9 to avoid bloat.
    One of them is a large DWG/DXF/DWF converter from/to MCD translator named mcAcon.dll.
    I already managed generating a COM typelib extraction with PB9 COM browser, consisting of 10246 Lines.
    I'm including some of the typical lines.
    The short descripted com handling syntax in the PB help file seems not to be enough to generate a valid code including this type library extraction.
    So, what do You imagine has to be the code syntax in this case?

    Code:
    ' Generated by: PowerBASIC COM Browser v.2.00.0058
    ' DateTime    : 21.01.2009 at 20:43
    ' ------------------------------------------------
    ' Library Name: DWGdirectX
    ' Library File: C:\Programme\MCADD\addon\dwgdirectx\DWGdirectX_2.06_6.dll
    ' Description : DWGdirectX 2.6 Type Library
    ' GUID : {EE2303F2-4EF6-42F6-92AB-4241221FF278}
    ' LCID : 0
    ' Version : 2.6
    
    ' Version Dependant ProgID's
    $PROGID_DWGdirectX_AcadApplication6 = "DWGdirectX.AcadApplication.2.6"
    $PROGID_DWGdirectX_AcadDocument6 = "DWGdirectX.AcadDocument.2.6"
    $PROGID_DWGdirectX_OdaHostApp6 = "DWGdirectX.OdaHostApp.2.6"
    '...Lots of them...
    
    ' Class Indentifiers
    $CLSID_DWGdirectX_AcadApplication = GUID$("{C58F8CBF-2B21-4A3C-971C-308D34C76363}")
    $CLSID_DWGdirectX_Event__DAcadApplicationEvents = GUID$("{809EAEAD-F340-41E2-A659-306960A1D996}")
    $CLSID_DWGdirectX_AcadDocument = GUID$("{7107EB99-D84A-404C-B1E0-284E82F54642}")
    '...Lots of them...
    
    ' Interface Indentifiers
    $IID_DWGdirectX_IAcadApplication = GUID$("{FDF9679C-B8F6-40B6-9F6B-207ADCF72BEE}")
    $IID_DWGdirectX_IAcadDocument = GUID$("{2880199D-CEB6-40D1-9505-B26E44488341}")
    $IID_DWGdirectX_IAcadDatabase = GUID$("{236374B2-E248-484D-91D4-C13FA726645D}")
    '...Lots of them...
    
    'Macros and Enums
    '...Lots of them...
    
    ' Interface Name  : IAcadApplication
    ' Description     : An instance of the DWGdirectX application
    ' ClassID         : $CLSID_DWGdirectX_AcadApplication
    ' ProgID          : $PROGID_DWGdirectX_AcadApplication
    ' Version ProgID  : $PROGID_DWGdirectX_AcadApplication6
    Interface IAcadApplication $IID_DWGdirectX_IAcadApplication 
        Inherit IDispatch
    
        Property Get Visible <1> () As Integer
        Property Set Visible <1> (ByVal PB_Visible As Integer)
        Property Get Name <2> () As String
    '...Lots of them...
    
    ' Interface Name  : Int__DAcadApplicationEvents
    ' Description     : Event interface for AcadApplication
    ' ClassID         : $CLSID_DWGdirectX_Event__DAcadApplicationEvents
    ' ProgID          : $PROGID_DWGdirectX_AcadApplication
    ' Version ProgID  : $PROGID_DWGdirectX_AcadApplication6
    Class Class_Int__DAcadApplicationEvents $CLSID_DWGdirectX_Event__DAcadApplicationEvents As Event
        Interface Int__DAcadApplicationEvents $IID_DWGdirectX_Int__DAcadApplicationEvents 
            Inherit IDispatch
    
            Method SysVarChanged <1> (Byval SysvarName As String, Byval newVal As Variant)
                ' Insert your code here
            End Method
    
            Method NewDrawing <2> ()
                ' Insert your code here
            End Method
    '...Lots of them...
    Norbert Doerre

  • #2
    >So, what do You imagine has to be the code syntax in this case?

    The code syntax to do WHAT?

    As new as I am to all this OO stuff (and I really am new) , I'm muddling thru it using the help file and the info I can find in the "Programming With Objects" forum.

    I have learned - much to my relief - that at least some part of this was familiar: that the required syntax depends on what I want to do.

    MCM
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Thank You

      Well, using the PB9 COM Browser gives a result from that .tlb of 460KB.
      The one of José Roca (4.0) gives back 2.700 KB.
      Now I know what to do.
      Tank You for Yor kind help, Michael.
      Norbert Doerre

      Comment


      • #4
        But this is only because the output of my browser is more verbose.

        Instead of

        Code:
            Property Get Visible <1> () As Integer
            Property Set Visible <1> (ByVal PB_Visible As Integer)
            Property Get Name <2> () As String
        it outputs

        Code:
           ' =====================================================================================
           PROPERTY GET Visible <1> ( _                         ' VTable offset = 28
           ) AS INTEGER                                         ' [retval][out] *Visible VT_BOOL <Integer>
           ' =====================================================================================
           PROPERTY SET Visible <1> ( _                         ' VTable offset = 32
             BYVAL INTEGER _                                    ' [in] Visible VT_BOOL <Integer>
           )                                                    ' void
           ' =====================================================================================
           PROPERTY GET Name <2> ( _                            ' VTable offset = 36
           ) AS STRING                                          ' [retval][out] *pAppName VT_BSTR
           ' =====================================================================================
        Forum: http://www.jose.it-berater.org/smfforum/index.php

        Comment


        • #5
          Well, using the PB9 COM Browser gives a result from that .tlb of 460KB.
          The one of José Roca (4.0) gives back 2.700 KB.
          That explains your question better than your original post.

          The original post reads "I created the INC file. Now what do I do?"
          Michael Mattias
          Tal Systems Inc. (retired)
          Racine WI USA
          [email protected]
          http://www.talsystems.com

          Comment

          Working...
          X