Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB Program return Code

Posted on 1997-04-07
5
Medium Priority
?
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 

Expert Comment

by:Pechatnikov Michael
ID: 1425117
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
ID: 1425118
I know how to do it.  Email me when the question is no longer locked.
0
 

Author Comment

by:schneidd
ID: 1425119
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
ID: 1425120
My Email ls Msoft@netmedia.net.il
Thanks,
            Pechatnikov Michael

0
 

Accepted Solution

by:
vbstone earned 200 total points
ID: 1425121
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

715 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