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?
I referenced Reflection1 as usual. It won't even call the sub if the CreateObject is there.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
The WriteFile is for debugging. Help
Rel


Reply With Quote