VB Return Codes

Hi,

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

Thank You
kriddleAsked:
Who is Participating?
 
TravisHallConnect With a Mentor Commented:
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
 
bppraveen001Commented:
Hi Kriddle,
    Can you give me some more details about what you want?
0
 
kriddleAuthor Commented:
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
 
TravisHallCommented:
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
 
kriddleAuthor Commented:
Thank you TravisHall,

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

K
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.