CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2001
    Posts
    7

    Services in VB, is it posssible ?

    I have to make service that will execute every day, like in 18:00 and perform some task.
    Is it possible or can you point me to some documents.


  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: Services in VB, is it posssible ?

    You could write a formless VB application (just a sub main) and run it using the NT scheduler.

    e.g.
    AT 18:00 /every:1234567 /interactive myexe.exe





    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

  3. #3
    Join Date
    Sep 2001
    Posts
    7

    Re: Services in VB, is it posssible ?

    That is OK idea, but what is happening if no user is logged.
    Is is posssible to make real service ?


  4. #4
    Join Date
    Oct 2001
    Posts
    1

    Re: Services in VB, is it posssible ?

    hi,

    The Windows NT version 4.0 resource kit provides a tool called SrvAny.exe for this purpose. This tool is actually a simple Windows NT service, which when started, spawns any regular Win32 application specified in its startup parameters. Please see SrvAny.wri in the Windows NT 4.0 resource kit for documentation of this tool.

    Please note that spawning a process from a service is different from converting the process itself into a service. The latter may be the preferable option under certain circumstances (for example, if the process in question is an OLE server).


    Another way is to use a third party active x control in your application which can make it a service.



  5. #5
    Join Date
    Sep 2001
    Posts
    7

    Re: Services in VB, is it posssible ?

    Thanks for answering,

    I forgot to mention, that I am using W2K, any solution for this except scheduler ?


  6. #6
    Join Date
    Oct 2001
    Location
    Phoenix, AZ
    Posts
    54

    Re: Services in VB, is it posssible ?

    http://msdn.microsoft.com/code/defau...srvocx_htm.asp

    You need to install the NTSvc.ocx. I've heard it works well.

    Cheers,

    John

    Software is like sex, it's better when it's free - Linus Torvalds
    Software is like sex, it's better when I get paid for it. - me

  7. #7
    Join Date
    Sep 2001
    Posts
    7

    Re: Services in VB, is it posssible ?

    I tried it, it is working fine.

    Thanks.


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