Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. VB6 Simple Question I think

VB6 Simple Question I think

Scheduled Pinned Locked Moved Visual Basic
questiontutorial
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dougstratton
    wrote on last edited by
    #1

    I have a vb6 app with no forms that is run in dos window. How do I output to the window if I want to send a message. No Msgbox (I don't want things popping up) so I want something like this c:\ingroup c:\You must provide a parameter with ingroupc c:\Example ingroup /i Something like that if possible? thanks

    D 1 Reply Last reply
    0
    • D dougstratton

      I have a vb6 app with no forms that is run in dos window. How do I output to the window if I want to send a message. No Msgbox (I don't want things popping up) so I want something like this c:\ingroup c:\You must provide a parameter with ingroupc c:\Example ingroup /i Something like that if possible? thanks

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      VB6 couldn't target a console app. You have to call into the Win32 API to create a console and output to it. You might want to try here[^] for a couple of console classes for VB6. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      D 1 Reply Last reply
      0
      • D Dave Kreskowiak

        VB6 couldn't target a console app. You have to call into the Win32 API to create a console and output to it. You might want to try here[^] for a couple of console classes for VB6. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        D Offline
        D Offline
        dougstratton
        wrote on last edited by
        #3

        Thanks I will take a look at the samples. Do you happen to know how I pass a error level code back after terminating the code? I want to check in the batch file for errors in the code. Thanks I found one thing but I put it in the code and tested it and it booted me out of VB and I lost it :) Forgot to save.

        D D 2 Replies Last reply
        0
        • D dougstratton

          Thanks I will take a look at the samples. Do you happen to know how I pass a error level code back after terminating the code? I want to check in the batch file for errors in the code. Thanks I found one thing but I put it in the code and tested it and it booted me out of VB and I lost it :) Forgot to save.

          D Offline
          D Offline
          dougstratton
          wrote on last edited by
          #4

          Also wanted to ask if there is an easier way to do this in vb.net?

          D 1 Reply Last reply
          0
          • D dougstratton

            Thanks I will take a look at the samples. Do you happen to know how I pass a error level code back after terminating the code? I want to check in the batch file for errors in the code. Thanks I found one thing but I put it in the code and tested it and it booted me out of VB and I lost it :) Forgot to save.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            That would be done with the ExitProcess Win32 API function. VB6 can't do it natively.

            Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)
            .
            .
            ExitProcess(returnCode)

            This will have the effect of terminating your app immediately, so you better have everything cleaned up before you call this. Also, when you launch a VB6 app from a batch file, it won't wait for it to complete. Unless, of course, you tell it to using:

            START /W vbApp.exe
            ...ERRORLEVEL statements go here
            

            RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            M 1 Reply Last reply
            0
            • D dougstratton

              Also wanted to ask if there is an easier way to do this in vb.net?

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              All of this is trivial in VB.NET since it, and any other language targeting the .NET Framework, can target a console app. Support for I/O redirection and exit codes are included. Even better support is included in the .NET Framework 2.0 and Visual Studio/Basic .NET 2005. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              1 Reply Last reply
              0
              • D Dave Kreskowiak

                That would be done with the ExitProcess Win32 API function. VB6 can't do it natively.

                Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)
                .
                .
                ExitProcess(returnCode)

                This will have the effect of terminating your app immediately, so you better have everything cleaned up before you call this. Also, when you launch a VB6 app from a batch file, it won't wait for it to complete. Unless, of course, you tell it to using:

                START /W vbApp.exe
                ...ERRORLEVEL statements go here
                

                RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                M Offline
                M Offline
                m_hussein
                wrote on last edited by
                #7

                hi i have strange problem in my project the keybord some time hange and you must trun off the keyborad sokt and trun on again for can type again can you help me and how i save picture in database and view in vb6 program

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups