Solved

VB Program return Code

Posted on 1997-04-07
5
195 Views
Last Modified: 2008-03-17
Is there a way to let a VB program return a result code on exit?

I need this for cooperation with Plus! system Agent which want's that programs give a return code on exit.
0
Comment
Question by:schneidd
  • 2
  • 2
5 Comments
 

Expert Comment

by:Pechatnikov Michael
Comment Utility
Hello !
I think that,
In Visual Basic You Have app object and it have all properties
of your application.

You have only one way to terminate your application, it`s End & Stop Statements and it`s cann`t return any value (Like in C++ for example)


I suggest you to look in Help about 'app' object and all it`s properties.
I`m sorry, I`m now in other computer so I haven`t visual Basic here and can`t to check it myself.

0
 

Expert Comment

by:vbstone
Comment Utility
I know how to do it.  Email me when the question is no longer locked.
0
 

Author Comment

by:schneidd
Comment Utility
Hey vbstone,

would like to e-mail to you, but couldn't find your e-mail adress here. (This is my first attemt to use Exp.Exchng., so maybe i do something wrong) Please e-mail me the solution to schneidd@silyn.net

thanks
0
 

Expert Comment

by:Pechatnikov Michael
Comment Utility
My Email ls Msoft@netmedia.net.il
Thanks,
            Pechatnikov Michael

0
 

Accepted Solution

by:
vbstone earned 100 total points
Comment Utility
I believe that the original poster is correct, there is no way to provide a return code directly.  But what you can do is a sneaky hack to do it.  Before your VB app terminates, have it write the return code in a file somewhere on your disk, such as an .ini file.  Then write a C++ .exe which executes your VB app, and when the VB app returns, have the C++ app read the file for the return code.  Then it should return that code itself.  Finally, have your original app shell to the C++ code!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now