?
Solved

Return A Value Thru EXE

Posted on 2003-03-16
6
Medium Priority
?
177 Views
Last Modified: 2010-05-01
All,

   Now the req is like this... I have to create an exe in VB, which when executed thru DOS (a batch file) the result of the VB must get stored in DOS variable....

  EX: if the exe returns say 20030316
     

    if I have said %1 = c:\Proj1.exe

   then echo %1 should return 20030316

Please Help
Thanks
0
Comment
Question by:ananthu
6 Comments
 
LVL 1

Expert Comment

by:robertlees
ID: 8149355
I've not tried it, but I don't think you can do this. VB programs must operate in the Windows environment. DOS doesn't know how to locate and link routines in DLLs, and VB programs rely heavily on DLLs.
0
 
LVL 1

Expert Comment

by:hmadhur
ID: 8149727
First of all you cannot run a VB application in DOS. Try VC++ by statically linking MFC dlls. Then you can execute it in Dos env also. VB as far as I know, can't be done. But anyways I'll give it a try.

Good Luck.
0
 

Author Comment

by:ananthu
ID: 8149834
I am not running it in a DOS environment. I am running it in Windowns Environment but thru DOS....
0
Industry Leaders: 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!

 

Accepted Solution

by:
Chimo earned 60 total points
ID: 8185171
Use the api ExitProcess to terminate your application

Public Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)

To return 30316, you only have to do

Call ExitProcess(30316)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/exitprocess.asp

0
 

Expert Comment

by:CleanupPing
ID: 8532250
Hi ananthu,
This old question (QID 20552935) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 8956466
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

-->Accept Chimo's comments as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

GPrentice00
EE Cleanup Volunteer
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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

609 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