Re: Stand alone Executable return argument

From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 10/28/04


Date: Thu, 28 Oct 2004 09:29:40 -0400

Sunny,

    You could do a number of things, but you won't be able to get a return
value back through the parameters, or through the return value. The entry
point for the application can only return an integer (which does not meet
your needs) and it can not modify the command line arguments. Any signal
that you send (perhaps an event, not the kind in .NET, but the
synchronization object) would have to be something that the other programs
actively listen for.

    Because of these needs, it really is a better idea if you place it in a
component and have the clients or something else call the component. This
way, you can be more sure when the method completes, (instead of waiting for
an event, you just wait until the method call completes).

-- 
               - Nicholas Paldino [.NET/C# MVP]
               - mvp@spam.guard.caspershouse.com
"Sunny" <Sunny@discussions.microsoft.com> wrote in message 
news:EFA8ED86-7C2A-43A0-8264-DFBFA41E7BD8@microsoft.com...
>I appreciate all the help, I am in fact writing out a set of Xml files at
> this time as my work process and at the end of the process i am infact
> invoking a third application that in turns (indirectly) signals to my 
> caller
> as a signal of my work completion. However this app is being used almost 
> by
> all the other apps and i have been told to return a signal to the caller 
> that
> i have finished my work in addition to the files written out, since they
> don't always want to go and read the files as such.
>
> But I think there has got to be a way for the.  static void main(string[]
> args) to return some signal values to their callers, this simply defies 
> all
> logic that this is not prossible in this scenario...
> would look forward to any more suggestions. . .
>
> Thanks for the Help,
>
> With Regards
> Sunny
>
>
>
> "Nicholas Paldino [.NET/C# MVP]" wrote:
>
>> Sunny,
>>
>>     You really aren't going to be able to pass a value back through the
>> executable.  The best you could do is pass an integer back to the process
>> that triggered you.
>>
>>     If possible, you should refactor this code out into a component, and
>> integrate that component into the other applications that need it.  It 
>> would
>> be easy enough to expose this as a .NET and a COM component, which should
>> allow you to access it from almost anywhere.
>>
>>     If you need to keep this as an executable, then you might want to
>> consider having it write out files to another directory, which you can
>> relate to the original files, which have the MD5 hash in them, or store 
>> the
>> hashes in some other persistant format (like a database) where the other
>> applications can get to it.
>>
>>     Hope this helps.
>>
>>
>> -- 
>>                - Nicholas Paldino [.NET/C# MVP]
>>                - mvp@spam.guard.caspershouse.com
>>
>> "Sunny" <Sunny@discussions.microsoft.com> wrote in message
>> news:61F243CF-E0DD-4DE5-BAB3-E8DC70D3A03F@microsoft.com...
>> > Hi,
>> > I have a very serious issue at hand. I have created a small C# Console 
>> > App
>> > (Csd.exe) that collects a list of files as its argument and generates
>> > their
>> > Md5 sets.
>> > This application is used by other applications in my dept, which simply
>> > call
>> > this Csd.exe app and passing a list of files.
>> > I want to ask how can I return a value from this Csd.exe application as 
>> > an
>> > indicator or a signal to the calling app that Csd.exe has finished
>> > working.
>> > The problem is that the main component of my Csd.exe is a
>> >
>> > public static void main(string[] args)
>> > {
>> >    //All the work
>> >    //And that is it (done)!
>> >   //Here i want to enter a return int or a bool (true) so that the 
>> > caller
>> > can know
>> >   //that i am finished processing....
>> > }
>> >
>> > The Static void main does not let me return anything. How can i do 
>> > that.
>> >
>> > Please HELP!
>> >
>> > Thanks and Regards
>> > Sunny
>> >
>>
>>
>> 


Relevant Pages

  • Re: Stand alone Executable return argument
    ... invoking a third application that in turns signals to my caller ... However this app is being used almost by ... > integrate that component into the other applications that need it. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Stand alone Executable return argument
    ... infact i am writing out an xml file as my work process ... and at the end my app is invoking a third application that signals to my ... caller as a signal of my work completion, but this app is being used by a lot ... > integrate that component into the other applications that need it. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: the police was dispatched to ... the wrong house
    ... and ptocessing Caller ID. ... it is not the central stations ... receiving daily test signals. ... Sarasota · Florida · 34233 ...
    (alt.security.alarms)
  • Re: Q: selinux_bprm_committed_creds() && signals/do_wait
    ... We don't want the caller to be able to arrange conditions that prevent ... correct handling of signals by the callee. ... If we trust the caller to do so, ...
    (Linux-Kernel)
  • Re: Q: selinux_bprm_committed_creds() && signals/do_wait
    ... We don't want the caller to be able to arrange conditions that prevent ... correct handling of signals (e.g. SIGHUP) by the callee. ...
    (Linux-Kernel)