Visual Basic as client

In Visual Basic, you can connect to the registered object using its program ID (late binding). In Visual Basic 5 or later, you can also use its class name (early binding).

StepsTo access a PowerBuilder COM object in Visual Basic:

  1. Do one of the following:

  2. Check that the connection was established:

    Dim response
    If EmpObj Is Nothing Then
    response = MsgBox("Creating Employee Object", 
          vbOKOnly, "Error")
    End If
    
  3. Access functions or properties of the object:

    Dim units, time as Long
    Dim DoubleReturn as Double
    Dim StringReturn As String
    
    DoubleReturn = EmpObj.f_calcdayavg units, time 
    StringReturn = EmpObj.f_teststring
    EmpObj.ll_hours = 37
    
  4. Destroy the object:

    Set EmpObj = Nothing