Shared application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nak

    Shared application

    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
    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\


  • Jan

    #2
    Re: Shared application

    Hi Nick,

    To share the assembly just have it loaded in the GAC, instead of in each
    applications local directory. Mind however that this requires "strong
    naming" for the assembly.

    Hopes this helps,
    Jan

    "Nak" <a@a.com> wrote in message
    news:OyAnyN0kDH A.3316@tk2msftn gp13.phx.gbl...[color=blue]
    > 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.
    >
    > --
    >[/color]
    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\[color=blue]
    > "No matter. Whatever the outcome, you are changed."
    >
    > Fergus - September 5th 2003
    >[/color]
    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\[color=blue]
    >
    >[/color]


    Comment

    • Guest's Avatar

      #3
      Re: Shared application

      will it also get installed in com+[color=blue]
      >-----Original Message-----
      >Hi Nick,
      >
      >To share the assembly just have it loaded in the GAC,[/color]
      instead of in each[color=blue]
      >applications local directory. Mind however that this[/color]
      requires "strong[color=blue]
      >naming" for the assembly.
      >
      >Hopes this helps,
      >Jan
      >
      >"Nak" <a@a.com> wrote in message
      >news:OyAnyN0kD HA.3316@tk2msft ngp13.phx.gbl.. .[color=green]
      >> Hi there,
      >>
      >> In VB6 if I wanted to make a shared application so[/color][/color]
      to speak I would[color=blue][color=green]
      >> create an ActiveX EXE. This would allow me to expose[/color][/color]
      objects of the[color=blue][color=green]
      >> application but only have 1 instance loaded. What is[/color][/color]
      the equivilent in[color=blue][color=green]
      >> VB.NET? Would I create a normal assembly that can be[/color][/color]
      communicated with[color=blue][color=green]
      >> using remoting? or are there other ways?
      >>
      >> Thanks in advance.
      >>
      >> Nick.
      >>
      >> --
      >>[/color]
      >/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/[/color]
      \/\/\/\/\/\/\/\/\/\[color=blue][color=green]
      >> "No matter. Whatever the outcome, you are changed."
      >>
      >> Fergus - September 5th 2003
      >>[/color]
      >/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/[/color]
      \/\/\/\/\/\/\/\/\/\[color=blue][color=green]
      >>
      >>[/color]
      >
      >
      >.
      >[/color]

      Comment

      • Nak

        #4
        Re: Shared application

        Hi there,
        [color=blue]
        > To share the assembly just have it loaded in the GAC, instead of in each
        > applications local directory. Mind however that this requires "strong
        > naming" for the assembly.[/color]

        Yes, I understand this, but it is not the same as an ActiveX executable.
        With an ActiveX executable you can have 1 instance of an application
        launched and have its objects exposed and used by other applications as if
        it were a DLL of some kind, but it had the benefit of being a running
        application.

        I'll give you an example of the use,

        * I have a shared application that downloads data from the internet
        on request of other applications, just a like a download manager, but each
        request is qued so only 1 is downloading at a time.

        * When the shared application is first called it is loaded, unless it
        is already loaded then the existing instance is used, instead of launching a
        new one.

        * The properties of the shared application are visible to all that
        are consuming it, that being if one were to change a property, all of the
        other applications consuming it would be able to see the change.

        I can think of one way so far, and that is by using remoting, but I'm
        not sure if this is a little overkill for what I wanted. Unless of course
        you are saying that you can load *any* assembly into the GAC and have it's
        objects exposed? I haven't tried this approach as I wasn't sure that you
        could.

        Nick.

        --
        /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
        "No matter. Whatever the outcome, you are changed."

        Fergus - September 5th 2003
        /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\


        Comment

        • Fergus Cooney

          #5
          Re: Shared application

          Howdy Nick,

          It sounds like you are talking about the .NET equivalent of Automation. Is
          this the case or is it that you want just a single instance, so if a second
          starts up it will defer to the first?

          Regards,
          Fergus


          Comment

          • Nak

            #6
            Re: Shared application

            Hi Fergus,
            [color=blue]
            > It sounds like you are talking about the .NET equivalent of[/color]
            Automation. Is[color=blue]
            > this the case or is it that you want just a single instance, so if a[/color]
            second[color=blue]
            > starts up it will defer to the first?[/color]

            Basically, I want an executable that exposes an interface for other
            applications wanting to consume it. Umm, I'm trying to think of an example,
            lets say I have an application running that exposes an interface, and that
            interface contains 1 method, that method being

            tellMeYourName( Byval iName as string)

            Any other application could call this method and the application would
            display any passed names into a list box. Hmm, I'm not even sure if that is
            a good example, the only way I could think of was remoting, but I'm not
            quite sure how I would achieve this.

            Isn't remoting just TCP/IP but with serializable objects being passed
            backwards and forwards? So basically, would I do this by creating
            serializable request and response objects in a completely different
            assembly. The make a host that recieves the request object, processes it
            and then sends back a response object to the client? That sounds like it
            would make sence but I am not event sure if this is possible??

            Thanks for all your helps so far :-)

            Nick.

            --
            /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
            "No matter. Whatever the outcome, you are changed."

            Fergus - September 5th 2003
            /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\


            Comment

            • Fergus Cooney

              #7
              Re: Shared application

              Hi Nick,

              I'm afraid this is actually a thread that I'm watching so that I can learn
              something. No answers from me as yet.

              Remoting is an area that is definitely on my todo list but hasn't had its
              turn yet. In addition to some books on gaming, I've got an interesting book
              that goes into remoting. I must do something about them sometime (lol!).

              If remoting uses TCP/IP and serialised objects when on the same machine,
              it does sound like a hammer for a nut. I've seen posts from people talking
              about exposing COM interfaces from .NET - surely that must be possible so that
              you an automate like Word, Excel, etc. I don't know whether or how, though.
              And I'd certainly like to.

              In the absence of an official method, you could use good old Windows
              messages between your clients and your downloader. But let's see what ideas
              turn up from others.

              Regards,
              Fergus



              Comment

              • Nak

                #8
                Re: Shared application

                Hi Fergus,
                [color=blue]
                > Remoting is an area that is definitely on my todo list but hasn't had[/color]
                its[color=blue]
                > turn yet. In addition to some books on gaming, I've got an interesting[/color]
                book[color=blue]
                > that goes into remoting. I must do something about them sometime (lol!).[/color]

                LOL, cool :-)
                [color=blue]
                > If remoting uses TCP/IP and serialised objects when on the same[/color]
                machine,[color=blue]
                > it does sound like a hammer for a nut. I've seen posts from people talking
                > about exposing COM interfaces from .NET - surely that must be possible so[/color]
                that[color=blue]
                > you an automate like Word, Excel, etc. I don't know whether or how,[/color]
                though.[color=blue]
                > And I'd certainly like to.[/color]

                Yeah, I thought it was maybe the wrong choice too, it's also pretty unsecure
                as well I suppose, I would have to transmit encrypted data back and forth.
                Though I like the idea of the "shared application" existing on a different
                system in the network.
                [color=blue]
                > In the absence of an official method, you could use good old Windows
                > messages between your clients and your downloader. But let's see what[/color]
                ideas[color=blue]
                > turn up from others.[/color]

                --
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                "No matter. Whatever the outcome, you are changed."

                Fergus - September 5th 2003
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                "Fergus Cooney" <filter-1@tesco.net> wrote in message
                news:enqr9G2kDH A.976@tk2msftng p13.phx.gbl...[color=blue]
                > Hi Nick,
                >
                > I'm afraid this is actually a thread that I'm watching so that I can[/color]
                learn[color=blue]
                > something. No answers from me as yet.
                >[/color]
                [color=blue]
                >[/color]
                [color=blue]
                >[/color]
                [color=blue]
                >
                > Regards,
                > Fergus
                >
                >
                >[/color]


                Comment

                • Nak

                  #9
                  Re: Shared application

                  > In the absence of an official method, you could use good old Windows[color=blue]
                  > messages between your clients and your downloader. But let's see what[/color]
                  ideas[color=blue]
                  > turn up from others.[/color]

                  F*U*K*NG OUTLOOK!

                  Right.....

                  I was going to say, I'm thinking of this "singleton" thing now, I'm not sure
                  if that is what I want. Lets say this,

                  * The "shared application" creates a singleton object with a shared
                  method that enables other assemblies that register a communication object
                  with it

                  * When the singleton recieves these shared methods it stores the
                  communcation object in a hashtable in the "shared application" and
                  communicates via that

                  This sounds pretty easy, though I am not sure how feazable it is, I suppose
                  the singleton would have to have an event or delegate function to notify the
                  "shared application" of the recieving of the communication object.....

                  ~~ "shared application"

                  Private withevents thesingletonthi ng as new singletonthing
                  Private cHTeCommObjects as new hashtable

                  Private sub thesingletonthi ng_recievecommo bject(Byval iObject as object)
                  handles thesingletonthi ng.recievecommo bject
                  call cHTeCommObjects .add(iObject.Ge tHashCode,iObje ct)
                  End Sub

                  ~~

                  ~~ "consumer" of "shared application"

                  Private thesingletonthi ng as new singletonthing
                  Private mycommobject as new object

                  Private sub registerit()
                  call thesingletonthi ng.register(myc ommobject)
                  End sub

                  ~~

                  I know I missed allot if things out in this, I think I shall have to give it
                  a go tommorrow, too late now, but if the communication object contains a few
                  events for things like recieving data on the "shared application" side and
                  on the consumer side, and a method to transmit to both. Although these
                  would be exposed to both, hmm, I'm probably taking crap now.

                  Can any singleton guys throw light on this one? Thanks loads again :-)

                  Nick.

                  --
                  /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                  "No matter. Whatever the outcome, you are changed."

                  Fergus - September 5th 2003
                  /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                  "Fergus Cooney" <filter-1@tesco.net> wrote in message
                  news:enqr9G2kDH A.976@tk2msftng p13.phx.gbl...[color=blue]
                  > Hi Nick,
                  >
                  > I'm afraid this is actually a thread that I'm watching so that I can[/color]
                  learn[color=blue]
                  > something. No answers from me as yet.
                  >
                  > Remoting is an area that is definitely on my todo list but hasn't had[/color]
                  its[color=blue]
                  > turn yet. In addition to some books on gaming, I've got an interesting[/color]
                  book[color=blue]
                  > that goes into remoting. I must do something about them sometime (lol!).
                  >
                  > If remoting uses TCP/IP and serialised objects when on the same[/color]
                  machine,[color=blue]
                  > it does sound like a hammer for a nut. I've seen posts from people talking
                  > about exposing COM interfaces from .NET - surely that must be possible so[/color]
                  that[color=blue]
                  > you an automate like Word, Excel, etc. I don't know whether or how,[/color]
                  though.[color=blue]
                  > And I'd certainly like to.
                  >
                  > In the absence of an official method, you could use good old Windows
                  > messages between your clients and your downloader. But let's see what[/color]
                  ideas[color=blue]
                  > turn up from others.
                  >
                  > Regards,
                  > Fergus
                  >
                  >
                  >[/color]


                  Comment

                  • Jeffrey Tan[MSFT]

                    #10
                    RE: Shared application


                    Hi Nak,

                    Yes, you can use singleton pattern to guarantee that there will only be one
                    instance running.
                    For more information, you can refer to:


                    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:
                    Get detailed answers to common queries about Syncfusion Windows Forms components covering installation, features, licensing, and developer support.


                    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" <a@a.com>
                    | 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: <OyAnyN0kDHA.33 16@tk2msftngp13 .phx.gbl>
                    | Newsgroups: microsoft.publi c.dotnet.langua ges.vb
                    | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
                    | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
                    | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:146979
                    | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
                    |
                    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                    |
                    |
                    |

                    Comment

                    • Nak

                      #11
                      Re: Shared application

                      Hi Jeffrey,
                      [color=blue]
                      > Yes, you can use singleton pattern to guarantee that there will only be[/color]
                      one[color=blue]
                      > instance running.
                      > For more information, you can refer to:
                      > http://www.codeguru.com/columns/VB/PK021102.html[/color]

                      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
                      /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                      ""Jeffrey Tan[MSFT]"" <v-jetan@online.mi crosoft.com> wrote in message
                      news:fDTfqp6kDH A.1548@cpmsftng xa06.phx.gbl...[color=blue]
                      >
                      > Hi Nak,
                      >[/color]
                      [color=blue]
                      >
                      > Also, I think it is easy for you to use process class to check the[/color]
                      repeated[color=blue]
                      > instance.
                      > You can visit the link below for details:
                      > http://www.syncfusion.com/FAQ/WinFor...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" <a@a.com>
                      > | 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: <OyAnyN0kDHA.33 16@tk2msftngp13 .phx.gbl>
                      > | Newsgroups: microsoft.publi c.dotnet.langua ges.vb
                      > | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
                      > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
                      > | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:146979
                      > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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.
                      > |
                      > | --
                      > |
                      >[/color]
                      /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\[color=blue]
                      > | "No matter. Whatever the outcome, you are changed."
                      > |
                      > | Fergus - September 5th 2003
                      > |
                      >[/color]
                      /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\[color=blue]
                      > |
                      > |
                      > |
                      >[/color]


                      Comment

                      • Jeffrey Tan[MSFT]

                        #12
                        Re: Shared application


                        Hi Nak,

                        I think create as windows service is not a good idea.
                        I think my another way of solution that use Process class is suitable for
                        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" <a@a.com>
                        | References: <OyAnyN0kDHA.33 16@tk2msftngp13 .phx.gbl>
                        <fDTfqp6kDHA.15 48@cpmsftngxa06 .phx.gbl>
                        | 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: <#q1Ssp9kDHA.25 36@tk2msftngp13 .phx.gbl>
                        | Newsgroups: microsoft.publi c.dotnet.langua ges.vb
                        | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
                        | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
                        | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:147242
                        | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
                        |
                        /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                        | ""Jeffrey Tan[MSFT]"" <v-jetan@online.mi crosoft.com> wrote in message
                        | news:fDTfqp6kDH A.1548@cpmsftng xa06.phx.gbl...
                        | >
                        | > 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/WinFor...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" <a@a.com>
                        | > | 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: <OyAnyN0kDHA.33 16@tk2msftngp13 .phx.gbl>
                        | > | Newsgroups: microsoft.publi c.dotnet.langua ges.vb
                        | > | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
                        | > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
                        | > | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:146979
                        | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
                        | > |
                        | >
                        |
                        /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                        | > |
                        | > |
                        | > |
                        | >
                        |
                        |
                        |

                        Comment

                        • Nak

                          #13
                          Re: Shared application

                          Hi Jeffry,
                          [color=blue]
                          > I think create as windows service is not a good idea.[/color]

                          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.
                          [color=blue]
                          > I think my another way of solution that use Process class is suitable for
                          > you.[/color]

                          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
                          /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                          ""Jeffrey Tan[MSFT]"" <v-jetan@online.mi crosoft.com> wrote in message
                          news:AXv%23FDIl DHA.576@cpmsftn gxa06.phx.gbl.. .[color=blue]
                          >
                          > Hi Nak,
                          >[/color]
                          [color=blue]
                          >
                          > 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" <a@a.com>
                          > | References: <OyAnyN0kDHA.33 16@tk2msftngp13 .phx.gbl>
                          > <fDTfqp6kDHA.15 48@cpmsftngxa06 .phx.gbl>
                          > | 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: <#q1Ssp9kDHA.25 36@tk2msftngp13 .phx.gbl>
                          > | Newsgroups: microsoft.publi c.dotnet.langua ges.vb
                          > | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
                          > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
                          > | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:147242
                          > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
                          > |
                          > | Hi Jeffrey,
                          > |
                          > | > Yes, you can use singleton pattern to guarantee that there will only[/color]
                          be[color=blue]
                          > | 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.
                          > |
                          > | --
                          > |
                          >[/color]
                          /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\[color=blue]
                          > | "No matter. Whatever the outcome, you are changed."
                          > |
                          > | Fergus - September 5th 2003
                          > |
                          >[/color]
                          /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\[color=blue]
                          > | ""Jeffrey Tan[MSFT]"" <v-jetan@online.mi crosoft.com> wrote in message
                          > | news:fDTfqp6kDH A.1548@cpmsftng xa06.phx.gbl...
                          > | >
                          > | > 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/WinFor...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" <a@a.com>
                          > | > | 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: <OyAnyN0kDHA.33 16@tk2msftngp13 .phx.gbl>
                          > | > | Newsgroups: microsoft.publi c.dotnet.langua ges.vb
                          > | > | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
                          > | > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
                          > | > | Xref: cpmsftngxa06.ph x.gbl[/color]
                          microsoft.publi c.dotnet.langua ges.vb:146979[color=blue]
                          > | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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.
                          > | > |
                          > | > | --
                          > | > |
                          > | >
                          > |
                          >[/color]
                          /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\[color=blue]
                          > | > | "No matter. Whatever the outcome, you are changed."
                          > | > |
                          > | > | Fergus - September 5th 2003
                          > | > |
                          > | >
                          > |
                          >[/color]
                          /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\[color=blue]
                          > | > |
                          > | > |
                          > | > |
                          > | >
                          > |
                          > |
                          > |
                          >[/color]


                          Comment

                          • Jeffrey Tan[MSFT]

                            #14
                            Re: Shared application


                            Hi Nak,

                            What I said Windows service is not a good idea means this is not a
                            recommanded solution.(Thoug h 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:
                            Get detailed answers to common queries about Syncfusion Windows Forms components covering installation, features, licensing, and developer support.

                            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:

                            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" <a@a.com>
                            | References: <OyAnyN0kDHA.33 16@tk2msftngp13 .phx.gbl>
                            <fDTfqp6kDHA.15 48@cpmsftngxa06 .phx.gbl>
                            <#q1Ssp9kDHA.25 36@tk2msftngp13 .phx.gbl>
                            <AXv#FDIlDHA.57 6@cpmsftngxa06. phx.gbl>
                            | 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: <uFNfbKKlDHA.22 68@TK2MSFTNGP12 .phx.gbl>
                            | Newsgroups: microsoft.publi c.dotnet.langua ges.vb
                            | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
                            | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
                            | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:147623
                            | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
                            |
                            /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                            | ""Jeffrey Tan[MSFT]"" <v-jetan@online.mi crosoft.com> wrote in message
                            | news:AXv%23FDIl DHA.576@cpmsftn gxa06.phx.gbl.. .
                            | >
                            | > 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" <a@a.com>
                            | > | References: <OyAnyN0kDHA.33 16@tk2msftngp13 .phx.gbl>
                            | > <fDTfqp6kDHA.15 48@cpmsftngxa06 .phx.gbl>
                            | > | 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: <#q1Ssp9kDHA.25 36@tk2msftngp13 .phx.gbl>
                            | > | Newsgroups: microsoft.publi c.dotnet.langua ges.vb
                            | > | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
                            | > | Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
                            | > | Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:147242
                            | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
                            | > |
                            | >
                            |
                            /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                            | > | ""Jeffrey Tan[MSFT]"" <v-jetan@online.mi crosoft.com> wrote in message
                            | > | news:fDTfqp6kDH A.1548@cpmsftng xa06.phx.gbl...
                            | > | >
                            | > | > 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/WinFor...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" <a@a.com>
                            | > | > | 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: <OyAnyN0kDHA.33 16@tk2msftngp13 .phx.gbl>
                            | > | > | Newsgroups: microsoft.publi c.dotnet.langua ges.vb
                            | > | > | NNTP-Posting-Host: dsl213-218-228-203.as15444.net 213.218.228.203
                            | > | > | Path:
                            cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
                            | > | > | Xref: cpmsftngxa06.ph x.gbl
                            | microsoft.publi c.dotnet.langua ges.vb:146979
                            | > | > | X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.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
                            | > | > |
                            | > | >
                            | > |
                            | >
                            |
                            /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                            | > | > |
                            | > | > |
                            | > | > |
                            | > | >
                            | > |
                            | > |
                            | > |
                            | >
                            |
                            |
                            |

                            Comment

                            Working...