Re: How to tell if running in console or winexe mode?
- From: "Sean Hederman" <email.jpg@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 18 Apr 2005 06:57:47 +0200
"D H" <no@spam> wrote in message news:R9udnSPEjp7qr_7fRVn-qQ@xxxxxxxxxxxxxx
> Tim Haugton wrote:
>> The question you're asking seems to indicate that you're doing
>> something peculiar.
>
> As I explained, I used an incredibly simple example - make a beep()
> function. One that works at all times. Regardless of winexe or exe.
> I don't see anything "peculiar" or unreasonable about asking if something
> so basic and simple is possible.
I think what Tim was trying to get across is that generally, if you are
targetting both Console and WinForms, you have two separate codebases
handling the presentation tier, and then you business and data tiers behind
them. Therefore, each codebase would only require the code it needs. The
console application would not use MessageBoxes, and the WinForms exe would
not use console I/O. Thus, the "something peculiar" you're doing is
approaching this from the wrong side. Rather than try to create a cross-UI
system library, it is far easier to simply have 2 presentation layers. Many
things in Windows UI do not cross well as concepts into Console UI and vice
versa. So the approach is "peculiar", not this specific instance (beep).
> (and if it's not, just say so, don't tell me I must be doing something
> wrong or peculiar for even asking).
He didn't say that, he said that you're doing something peculiar for trying
to have a single codebase crossing Console and Winforms. I don't understand
how you get from his first sentence above to an attack on you for asking
your question?
> I found an alternative in this one specific case is to call
> microsoft.visualbasic.interaction.beep() which works on Mono and .NET and
> in console or winexe apps. Of course that's not a very generalizable
> solution for other cases, is it?
No, it's not.
> Console Apps and Windows Apps are fundamentally
>> different animals. You'd be much better factoring out all common code
>> into a library, then having a seperate console app and Windows app that
>> uses the common code.
>
> It's a beep. It couldn't be more simple. There is no common code. What's
> uncommon about a beep?
Um, you actually said "Of course that's not a very generalizable solution
for other cases, is it?". This implies that you're looking at something more
extensive than a beep. You've already pointed out that you have a solution
for beep, and now Tim is quite delicately pointing out that your overall
approach is flawed, not the beep solution.
.
- References:
- How to tell if running in console or winexe mode?
- From: D H
- Re: How to tell if running in console or winexe mode?
- From: Tim Haugton
- Re: How to tell if running in console or winexe mode?
- From: D H
- How to tell if running in console or winexe mode?
- Prev by Date: Re: plugging into the explorer shell
- Next by Date: Help! What is wrong here ?
- Previous by thread: Re: How to tell if running in console or winexe mode?
- Next by thread: RE: How to tell if running in console or winexe mode?
- Index(es):
Relevant Pages
|
|