DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Launching a GUI program from a windows service

  1. #1
    Join Date
    Aug 2009
    Posts
    2

    Question Launching a GUI program from a windows service

    Hi,

    I have written a simple automation tool using vb.net. As it needs access to shared drives it needs to run as a user, so I can't run it as localSystem. Which means the interact with desktop method is not an option for me.

    The tool creates a list of command line files and parameters and then works through them, executing in separate processes. The code that handles this process is below (stripped of error handling code)

    Code:
     psi.RedirectStandardOutput = True
                psi.ErrorDialog = False
                psi.UseShellExecute = False
    
               p = Process.Start(psi)
       
               If p.WaitForExit(timeOut) = False Then
                        p.Kill()
                        p.WaitForExit()
               End If
    This works fine until I try to launch gui app (business objects 6.5) from one of the console apps. If I track it in the debugger, it briefly appears in the task manager and then dies. The code for this is below

    Code:
    _BoApp = New busobj.Application()'shows up briefly in TM
                _BoApp.Visible = False
                _BoApp.Interactive = False
                _BoApp.LoginAs("xxx","xxx", 0)
    Business Objects is being talked to through COM as it is too old to have a .net interop.

    I'm assuming that Business Objects can't connect to desktop and is therefore closing. If this is the case, is there anyway to provide a desktop for it? (A user will probably not be logged into the machine)

    Thanks,

    Matt

  2. #2
    Join Date
    May 2004
    Location
    Duluth MN
    Posts
    353
    Matt, why do you want to start a gui app if no one is logged in?

    ...joe

  3. #3
    Join Date
    Aug 2009
    Posts
    2
    We have quite a few reports built in Business Objects 6.5 and it would take a lot of work to rewrite them using a .net toolkit. Currently they're triggered from excel spreadsheets and someone physically has to click the buttons to run reports.

    The automation tool monitors the overnight load into the reporting database and then launches command line programs that run various reports when the load is finished. New reports are built using a .net toolkit and they work fine as there is no need for a gui. Some of the reports take a long time to run, so having the reporting start in the early hours when the load finishes and the database load is light is a real winner for us.

    I've written a console app that controls business objects through com. It's highly generic, the report to run, dates etc are passed via the command line. This allows us run 99% of our existing reports through the automation tool with the minimal amount of effort. So no one will be using the GUI, but Business Objects needs to be loaded to run the reports.

Similar Threads

  1. Replies: 0
    Last Post: 09-12-2007, 07:50 AM
  2. Windows service database problem
    By Sunder in forum .NET
    Replies: 0
    Last Post: 07-19-2007, 01:27 PM
  3. Replies: 2
    Last Post: 07-24-2006, 05:38 AM
  4. Windows Service Running on a Server
    By Stephen in forum .NET
    Replies: 1
    Last Post: 10-29-2002, 10:11 PM
  5. Replies: 1
    Last Post: 10-15-2001, 10:57 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center