Solved

VB Return Codes

Posted on 2001-06-26
5
250 Views
Last Modified: 2008-03-06
Hi,

Does anyone know if you can return a value (string, integer, etc...) from a VB executable called from VBScript.

Thank You
0
Comment
Question by:kriddle
  • 2
  • 2
5 Comments
 

Expert Comment

by:bppraveen001
ID: 6230266
Hi Kriddle,
    Can you give me some more details about what you want?
0
 

Author Comment

by:kriddle
ID: 6230542
I am calling this VB executable with a C++ exe running resident and I want to pass a return code from the exe back to the caller.
0
 
LVL 2

Expert Comment

by:TravisHall
ID: 6233364
Okay, so you already know about GetExitCodeProcess to retrieve the exit code set by the VB executable, so you know what that value is within your C++ program, yes?

And, of course, you have tried this and just get back 0, the exit code generally given by a successfully executed program. So, you need to know how to change that value to something else.

For this, you would use the API function ExitProcess, for which a VB declaration is given in Win32api.txt for use with the API viewer. A quick test of this function has told me that it can be used without causing a nasty error. However, you should be very careful to make sure it is the very last thing you do in that program, because it will end your program right there.
0
 

Author Comment

by:kriddle
ID: 6233527
Thank you TravisHall,

Have tried and succeeded with this. Your suggestion was right on the money.

K
0
 
LVL 2

Accepted Solution

by:
TravisHall earned 75 total points
ID: 6233544
Glad I could help. You might want to close off the question now, though.

(Unclosed questions is already becoming my pet peeve.)

(Hang on a minute, I've just realised that this is a 75 point question. Isn't that the number of points you get for signing up? Did you just sign up and commit all your points to the one question? If so, no matter. Fill out the new member's survey and get 125 more.)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use Multiple Forms 4 48
VB6 code to programmatically convert pdf to excel 21 66
Sending a email via excel using vba 6 71
how to know if my Checkbox is True in VB6.0? 9 36
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

930 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

14 Experts available now in Live!

Get 1:1 Help Now