How can you return a value (an integer) from a normal VB exe? The program has a 'sub main()' but sub's cannot return values and you can't make the main() sub a function. Any thoughts?
Hmm, that doesn't seem to work. I made an ActiveX EXE and then added the following code:
function main()
main = 1
end function
I then ran the program on the command line and checked the return value but it didn't return anything. Is there something that I'm missing or not doing right?
I'm confused here. Are u just making a dos program or do you have one program calling another one and wait for a return value from it?
I assumed you needed a way to call a different program from your program and have it return something. If this was the case, then an ActiveX EXE is just another class you can declare inside your VB program. You will need to reference it in project->reference.
If you're writing a DOS program and wants something printed out; that's a different story.
There is a MFC C++ application. That application needs to call a VB.exe and know if it succeeded in its execution. So basically from some kind of VB sub main() function I need to return a value to the calling program.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.