Announcement

Collapse
No announcement yet.

COM Dual Interface

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

  • COM Dual Interface

    I'm looking at migrating a messaging client application to a class so that it can be used as a COM/ActiveX object. And I'm new to COM. So, I have two initial questions that I'm hoping the COM gurus can help me with.

    1. The PB help files indicate that the DUAL interface is the only one which should be used if the methods will be used by a non-PB language. Is this still correct? I'm not sure which languages require a DISPATCH interface.

    2. If DUAL is the way to go, is this the correct way to wrap the class?
    Code:
    $ClassGUID = GUID$("{14EC6DEF-1BB8-416C-9171-471110ED27B8}")
    $IfaceGUID = GUID$("{DE0AFF33-D092-477A-92CB-32579362A0B4}")
    
    CLASS MyClass $ClassGUID AS COM
    INTERFACE MyInterface $IfaceGUID
    INHERIT DUAL
    
    METHOD MyMethod <1> (BYVAL x AS LONG) AS LONG
      METHOD = x + 1
    END METHOD
    
    END INTERFACE
    END CLASS
    Advice is always welcomed.

  • #2
    Help says that DUAL is a synonym for iDISPATCH. There are quite a few examples of iDISPATCH interfaces in the forums!

    Comment

    Working...
    X