COM Object won't run from Win Service
I'm trying to write a Windows Service that runs a COM object (WRQ Reflection Terminal Emulator) at regular intervals. This code works in a regular Win App. What am I doing wrong?
Code:
Private Sub RunReport()
WriteFile("RunReport " & Now)
Dim Fab2SPN As Reflection1.Session
Fab2SPN = CreateObject("Reflection1.Session")
WriteFile("Fab2SPN " & Now)
With Fab2SPN
.Visible = True
.ConnectionType = "BEST-NETWORK"
.ConnectionSettings = "Host SPNFAB1"
.Connect()
.WaitForHostTrigger()
End With
End Sub
Protected Overrides Sub OnStart(ByVal args() As String)
WriteFile ("Start " & Now)
RunReport()
End Sub
I referenced Reflection1 as usual. It won't even call the sub if the CreateObject is there.
The WriteFile is for debugging. Help
Rel