I'm trying to convert this code from VB Script to PB Win. I get an Error 99 as noted in the code. I can not figure out what is wrong. Can someone point me in the right direction.
Thanks
VB Script Code
PB Win 9.01 code
Thanks
VB Script Code
Code:
#IF 0 ' Working vbScript OPTION EXPLICIT CONST sAdminPassword = "password" DIM oApp SET oApp = CreateObject("hMailServer.Application") ' Authenticate the client. CALL oApp.Authenticate ("Administrator", sAdminPassword) MSGBOX oApp.Version, 0, "Server Version" MSGBOX oApp.Status.StartTime, 0, "Server Start Time" #ENDIF
Code:
#COMPILE EXE #DIM ALL #DEBUG DISPLAY ON #INCLUDE "hMailServer.inc" FUNCTION PBMAIN () AS LONG #DEBUG CODE ON DIM oServer AS IInterfaceApplication DIM sAdminPwd AS STRING sAdminPwd = INPUTBOX$("Enter administrator password", "hMailServer") LET oServer = NEWCOM $PROGID_hMailServer_Application IF ISOBJECT(oServer) THEN oServer.Authenticate ("Administrator", sAdminPwd) ? ACODE$(oServer.Version) ' PBWin 9.01 reports Error 99 on the next line. ? ACODE$(oServer.Status.StartTime) END IF LET oServer = NOTHING #DEBUG CODE OFF END FUNCTION
Comment