CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1
  1. #1
    Join Date
    Dec 2002
    Posts
    55

    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
    Last edited by Relentless; January 13th, 2006 at 07:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured