Click here to Skip to main content
16,003,873 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionSuitable criteria for a distributed application Pin
Zeeshan Riaz15-Jul-09 11:32
Zeeshan Riaz15-Jul-09 11:32 
AnswerRe: Suitable criteria for a distributed application Pin
DaveyM6915-Jul-09 13:01
professionalDaveyM6915-Jul-09 13:01 
QuestionSingle-instance applications and batch files Pin
supercat915-Jul-09 5:59
supercat915-Jul-09 5:59 
AnswerRe: Single-instance applications and batch files Pin
Luc Pattyn16-Jul-09 1:36
sitebuilderLuc Pattyn16-Jul-09 1:36 
GeneralRe: Single-instance applications and batch files Pin
supercat916-Jul-09 13:20
supercat916-Jul-09 13:20 
GeneralRe: Single-instance applications and batch files Pin
Luc Pattyn16-Jul-09 13:26
sitebuilderLuc Pattyn16-Jul-09 13:26 
GeneralRe: Single-instance applications and batch files Pin
supercat917-Jul-09 4:41
supercat917-Jul-09 4:41 
GeneralRe: Single-instance applications and batch files Pin
Luc Pattyn17-Jul-09 11:40
sitebuilderLuc Pattyn17-Jul-09 11:40 
Hi,

OK, once more too much C# was popping up in my thinking and reply.

What I called Main() would be whatever piece of your VB.NET code gets in charge first.
I keep forgetting Visual for VB has special single-instance support. I don't know any details, I never used it; if I were interested, I would launch Reflector and have a peek inside.

Most of my C# toolbox was created in either 1.1 or 2.0; when building for 3.x it is bound to contain P/Invoke for a couple of things that now can be handled natively. I do use P/Invoke for named pipes, as I still often build for 2.0

In order to achieve the scheme I proposed in VB.NET you most likely would have to forgo the built-in "single-instance" support, and create your own.


supercat9 wrote:
windowed applications can't do that


Yes, it is unfortunately true. The PE file format has a single bit that chooses between:
- a console app, which needs a console to run; when launched in a command prompt/DOS window, it will use that; otherwise it will create its own console window. Your app can create forms and look very much like a WinForm app, however it is a console app. It can hide its own console, but only after it has been shown briefly resulting in an ugly flash.
- a non-console app. Now it again can crate forms and be a real WinForm app, or it can choose not to, and maybe show up in the systray. What it can't do is perform input/output to a command prompt/DOS window that maybe launched it.

I have been struggling with this for some time, as I wanted to create apps that:
- when a command line is present, behave as console apps (so you can use them silently in a batch file);
- when a command line isn't present, behave as WinForm apps (so you can use them interactively).
And I didn't want to create, maintain and distribute two EXEs, one for each purpose.
I had to give up, IMO this historical dichotomy has proven to be a major Windows blunder.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Single-instance applications and batch files Pin
supercat917-Jul-09 13:21
supercat917-Jul-09 13:21 
GeneralRe: Single-instance applications and batch files Pin
Luc Pattyn17-Jul-09 13:57
sitebuilderLuc Pattyn17-Jul-09 13:57 
GeneralRe: Single-instance applications and batch files Pin
supercat920-Jul-09 4:56
supercat920-Jul-09 4:56 
QuestionSpell Check Recommendations Pin
musefan15-Jul-09 5:11
musefan15-Jul-09 5:11 
AnswerRe: Spell Check Recommendations Pin
Luc Pattyn15-Jul-09 6:30
sitebuilderLuc Pattyn15-Jul-09 6:30 
GeneralRe: Spell Check Recommendations Pin
musefan15-Jul-09 6:43
musefan15-Jul-09 6:43 
GeneralRe: Spell Check Recommendations Pin
Luc Pattyn15-Jul-09 6:45
sitebuilderLuc Pattyn15-Jul-09 6:45 
Questionhow to pass values from pop-up window(child page) to a master page(parant page) datagrid? please help me out [modified] Pin
staycool_khan15-Jul-09 4:11
staycool_khan15-Jul-09 4:11 
AnswerRe: how to pass values from pop-up window(child page) to a master page(parant page) datagrid? please help me out Pin
Not Active15-Jul-09 4:56
mentorNot Active15-Jul-09 4:56 
QuestionHow to create static library in C++ .net 2008 and call it from VC6 Pin
stefanidou15-Jul-09 1:46
stefanidou15-Jul-09 1:46 
AnswerRe: How to create static library in C++ .net 2008 and call it from VC6 Pin
Ravi Bhavnani18-Jul-09 6:13
professionalRavi Bhavnani18-Jul-09 6:13 
QuestionHow can patch .NET assembly code Pin
ham_tim_hieu14-Jul-09 21:29
ham_tim_hieu14-Jul-09 21:29 
AnswerRe: How can patch .NET assembly code Pin
Luc Pattyn15-Jul-09 2:55
sitebuilderLuc Pattyn15-Jul-09 2:55 
AnswerRe: How can patch .NET assembly code Pin
harold aptroot15-Jul-09 5:09
harold aptroot15-Jul-09 5:09 
GeneralRe: How can patch .NET assembly code Pin
ham_tim_hieu15-Jul-09 8:09
ham_tim_hieu15-Jul-09 8:09 
GeneralRe: How can patch .NET assembly code Pin
ham_tim_hieu16-Jul-09 16:24
ham_tim_hieu16-Jul-09 16:24 
GeneralRe: How can patch .NET assembly code Pin
harold aptroot16-Jul-09 16:33
harold aptroot16-Jul-09 16:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.