CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Exit code

  1. #1
    Join Date
    May 2001
    Location
    Montreal, Canada
    Posts
    6

    Exit code

    How can i send an exit code with a VB App? It's to be test with errorlevel in a batch file.


  2. #2
    Join Date
    Aug 2000
    Location
    Namibia
    Posts
    139

    Re: Exit code

    There's an API that'll do taht for you:
    private Declare Sub ExitProcess Lib "kernel32.dll" Alias "ExitProcess" _
    (byval uExitCode as Long)


    I'm not too sure whether you'll catch the errorlevel if the application has a Window's GUI (you may have to go the console way), but give it a bash.


  3. #3
    Join Date
    May 2001
    Location
    Montreal, Canada
    Posts
    6

    Re: Exit code

    Thank you! It works!


  4. #4
    Join Date
    Feb 2001
    Posts
    19

    Re: Exit code

    The API call always makes my application crash because of a memory access violation. Any ideas why?

    Daniel


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