PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Brad Warmuskerken on October 19, 2004, 01:36:39 PM

Title: ActiveX Get; Am I doing this right?
Post by: Brad Warmuskerken on October 19, 2004, 01:36:39 PM
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?
Title: ActiveX Get; Am I doing this right?
Post by: Jose Roca on October 19, 2004, 01:45:15 PM
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.
Title: ActiveX Get; Am I doing this right?
Post by: Brad Warmuskerken on October 19, 2004, 02:46:41 PM
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.