Hi Nak,
What I said Windows service is not a good idea means this is not a
recommanded solution.(Though I think it also can achieve what you want)
Windows service application is more complex and it can not have GUI
interface or CUI interface, so if you want to use windows service, you must
use this service as a subprogram for you application.(I think this is
inconvinience and is not a good idea)
The process class solution that I mentioned is judge the repeated process
by process name, details I have provided you in this link:
http://www.syncfusion.com/FAQ/WinForms/FAQ_c40c.asp#q550q
But I think this solution is also very well, other processes may have the
same name with you process.
So it seems that the better solution in .Net is using remoting, I have just
found an article related to only keep one instance through remoting, please
refer to the "Single-Instance Applications" and "Behind the Scenes"
sections in the link below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/
html/reaworapps1.asp?frame=true
I hope what I said make sence to you, if you still have any unclear, please
feel free to let me know, I am glad to work with you
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| From: "Nak" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
<#
[email protected]>
<AXv#
[email protected]>
| Subject: Re: Shared application
| Date: Fri, 17 Oct 2003 12:34:31 +0100
| Lines: 176
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:147623
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Hi Jeffry,
|
| > I think create as windows service is not a good idea.
|
| Well, considering I would like the application to be able to run on a
remote
| system if possible, this isn't that bad an idea. Why do you not think it
| would be a good idea? I'm interested to know, maybe I have missed some
| points.
|
| > I think my another way of solution that use Process class is suitable
for
| > you.
|
| I'm not quite sure what you mean by using the process class, I wasn't
aware
| that it allowed for interprocess communication? I have found a nice
little
| demo of a singleton design pattern being used in a remote object (In the
101
| VB.NET examples) and it seems like it might be what I want. I'm just
having
| issues trying to replecate exactly what I am after but I'm sure it might
be
| the way.
|
| Thanks for your help and advice.
|
| Nick.
|
| --
|
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
| "No matter. Whatever the outcome, you are changed."
|
| Fergus - September 5th 2003
|
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
| | >
| > Hi Nak,
| >
|
| >
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! -
www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Nak" <
[email protected]>
| > | References: <
[email protected]>
| > <
[email protected]>
| > | Subject: Re: Shared application
| > | Date: Thu, 16 Oct 2003 12:41:30 +0100
| > | Lines: 93
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <#
[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:147242
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > |
| > | Hi Jeffrey,
| > |
| > | > Yes, you can use singleton pattern to guarantee that there will only
| be
| > | one
| > | > instance running.
| > | > For more information, you can refer to:
| > | >
http://www.codeguru.com/columns/VB/PK021102.html
| > |
| > | I have just taken a look at the article, very interesting. I also
tried
| > to
| > | implement it but I came across an obvious downfall, you can only have
1
| > | instance of a singleton per process, so if I were to make 2 consumers
of
| > the
| > | singleton they would both use a completely different instance. I
hadn't
| > | thought of this happening even though it is quite obvious, unless
there
| > is a
| > | way to share the singleton between processes?
| > |
| > | I suppose maybe what I am actually after is making a windows service,
| > *but*
| > | I have not yet seen any examples that show how you communicate with a
| > | windows service other than to stop or start etc. Would this require
| > | remoting? Or is there some simple method that I have missed somewhere
| > along
| > | the lines? Thanks for your help
| > |
| > | Nick.
| > |
| > | --
| > |
| >
|
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
| > | "No matter. Whatever the outcome, you are changed."
| > |
| > | Fergus - September 5th 2003
| > |
| >
|
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
| > | | > | >
| > | > Hi Nak,
| > | >
| > |
| > | >
| > | > Also, I think it is easy for you to use process class to check the
| > | repeated
| > | > instance.
| > | > You can visit the link below for details:
| > | >
http://www.syncfusion.com/FAQ/WinForms/FAQ_c40c.asp#q550q
| > | >
| > | > Hope this helps,
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! -
www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "Nak" <
[email protected]>
| > | > | Subject: Shared application
| > | > | Date: Wed, 15 Oct 2003 18:40:44 +0100
| > | > | Lines: 20
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <
[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.languages.vb
| > | > | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.vb:146979
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.vb
| > | > |
| > | > | Hi there,
| > | > |
| > | > | In VB6 if I wanted to make a shared application so to speak I
| > would
| > | > | create an ActiveX EXE. This would allow me to expose objects of
the
| > | > | application but only have 1 instance loaded. What is the
equivilent
| > in
| > | > | VB.NET? Would I create a normal assembly that can be communicated
| > with
| > | > | using remoting? or are there other ways?
| > | > |
| > | > | Thanks in advance.
| > | > |
| > | > | Nick.
| > | > |
| > | > | --
| > | > |
| > | >
| > |
| >
|
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
| > | > | "No matter. Whatever the outcome, you are changed."
| > | > |
| > | > | Fergus - September 5th 2003
| > | > |
| > | >
| > |
| >
|
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|