ActiveX Get; Am I doing this right?

Started by Brad Warmuskerken, October 19, 2004, 01:36:39 PM

Previous topic - Next topic

Brad Warmuskerken

In VB I have an ActiveX control that I would use in the following manner:

Dim X as Long
Dim sReturn as String

X = Svr.StartServer()
if X = 0 then
    'the server didn't start
    sReturn = Svr.GetLastError()
    msgbox sReturn
end if

Here's my PB/FF code:
Dim vVar as Variant

Object Get DISPATCH_FORM1_OCXCONTROL1.StartServer() To vVar

If Variant#(vVar) =  0 Then
    Object Get DISPATCH_FORM1_OCXCONTROL1.LastError To vVar
    sReturn = Variant$(vVar)
    MsgBox sReturn
End If           

Could someone tell me what I'm missing?

Jose Roca

StartServer is a method or a property? If it is a method the you have to use OBJECT CALL instead of GET.

In your VB example you use GetLastError, but in your PB code you use LastError.

Brad Warmuskerken

Jose,

Thank you,  it was a method and I needed to use Object Call.
The LastError/GetLastError was a typo on my part when I posted the message.