Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Passing string between 2 applications VB

Passing string between 2 applications VB

Scheduled Pinned Locked Moved The Lounge
algorithmshelptutorialquestion
26 Posts 18 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U User 12663466

    Hello guys, am new at coding. I was searching alot for an example an i cant find what i need. The most examples that i found, the first application executes the application 2 and passing the text. I need the Application 2 opened all the time, and i need the Application 1 send to Application 2 only the data. any help??

    M Offline
    M Offline
    megaadam
    wrote on last edited by
    #4

    It just as easy as passing water!

    ... such stuff as dreams are made on

    1 Reply Last reply
    0
    • U User 12663466

      Hello guys, am new at coding. I was searching alot for an example an i cant find what i need. The most examples that i found, the first application executes the application 2 and passing the text. I need the Application 2 opened all the time, and i need the Application 1 send to Application 2 only the data. any help??

      T Offline
      T Offline
      Terence Wallace
      wrote on last edited by
      #5

      I would probably suggest saving the string in a temporary file and then have App2 to read the string from that file and delete it. You could also take a look at this CP Article: Passing Data between Windows Forms

      "If you feel the urge to add complexity, just go home early. You ain't gonna need it." - YAGNI

      OriginalGriffO realJSOPR 2 Replies Last reply
      0
      • realJSOPR realJSOP

        Member 12697037 wrote:

        Hello guys, am new at coding.

        Are you new at reading as well?

        ".45 ACP - because shooting twice is just silly" - JSOP, 2010
        -----
        You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
        -----
        When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

        K Offline
        K Offline
        Kevin Marois
        wrote on last edited by
        #6

        Hey John, look what I just got[^] Gonna try it out this weekend.

        If it's not broken, fix it until it is

        realJSOPR T 2 Replies Last reply
        0
        • T Terence Wallace

          I would probably suggest saving the string in a temporary file and then have App2 to read the string from that file and delete it. You could also take a look at this CP Article: Passing Data between Windows Forms

          "If you feel the urge to add complexity, just go home early. You ain't gonna need it." - YAGNI

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #7

          No, no - get App1 to create a new SQL DB table (with the timestamp as the table name) and enter it's string. App2 can access the DB and read the value before deleting the table. Much more multi user friendly and you could put it in the cloud and claim it as an IoT device! :-D

          Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          M 1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            No, no - get App1 to create a new SQL DB table (with the timestamp as the table name) and enter it's string. App2 can access the DB and read the value before deleting the table. Much more multi user friendly and you could put it in the cloud and claim it as an IoT device! :-D

            Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

            M Offline
            M Offline
            megaadam
            wrote on last edited by
            #8

            Stop stringing us on!

            ... such stuff as dreams are made on

            1 Reply Last reply
            0
            • K Kevin Marois

              Hey John, look what I just got[^] Gonna try it out this weekend.

              If it's not broken, fix it until it is

              realJSOPR Offline
              realJSOPR Offline
              realJSOP
              wrote on last edited by
              #9

              I have an Aimpoint Pro - the bushnell should work pretty good. I went out shooting this weekend. Spent 300 rounds. One guy wanted to buy my rifle because he liked the camo paint job. Offered me $1500 - I passed on the offer.

              ".45 ACP - because shooting twice is just silly" - JSOP, 2010
              -----
              You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
              -----
              When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

              M M 2 Replies Last reply
              0
              • T Terence Wallace

                I would probably suggest saving the string in a temporary file and then have App2 to read the string from that file and delete it. You could also take a look at this CP Article: Passing Data between Windows Forms

                "If you feel the urge to add complexity, just go home early. You ain't gonna need it." - YAGNI

                realJSOPR Offline
                realJSOPR Offline
                realJSOP
                wrote on last edited by
                #10

                He could also write a Windows service that uses WCF to receive the string, encrypt it, send it to a web site which would store it in a database, and then have his other app periodically poll the web site with a WebClient object that would cause the web site to check the database for new data. Once the data is retrieved, he would then have to call another page on the web site to delete the data that was just retrieved. Then there's all the transaction processing that needs to occur, not to mention the necessity for code that makes sure the string is different from the last time he retrieved it, as well as maintaining a cache of retrieved strings to ensure no duplication has occurred. If he wants it to be configurable, he 'd have a lot more work to do as well. We haven't even GOTTEN to the act of logging everything in the system log yet.

                ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                -----
                You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                -----
                When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                W 1 Reply Last reply
                0
                • U User 12663466

                  Hello guys, am new at coding. I was searching alot for an example an i cant find what i need. The most examples that i found, the first application executes the application 2 and passing the text. I need the Application 2 opened all the time, and i need the Application 1 send to Application 2 only the data. any help??

                  R Offline
                  R Offline
                  R Giskard Reventlov
                  wrote on last edited by
                  #11

                  Buy an envelope and stamp. Put the string in the envelope and the stamp on it. Address it to the second app. Post it. Eventually it will arrive.

                  F J 2 Replies Last reply
                  0
                  • R R Giskard Reventlov

                    Buy an envelope and stamp. Put the string in the envelope and the stamp on it. Address it to the second app. Post it. Eventually it will arrive.

                    F Offline
                    F Offline
                    Foothill
                    wrote on last edited by
                    #12

                    I would also suggest placing the envelope in a transporter from StarTrek so that the message can be properly digitized and encoded for transmission to the second app.

                    if (Object.DividedByZero == true) { Universe.Implode(); } Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016

                    1 Reply Last reply
                    0
                    • U User 12663466

                      Hello guys, am new at coding. I was searching alot for an example an i cant find what i need. The most examples that i found, the first application executes the application 2 and passing the text. I need the Application 2 opened all the time, and i need the Application 1 send to Application 2 only the data. any help??

                      T Offline
                      T Offline
                      TheGreatAndPowerfulOz
                      wrote on last edited by
                      #13

                      App1 can encode the string as a series of sounds that are emitted by the pc speaker (preferably using frequencies not human detectable). Then App2 listens for these frequencies using the microphone and decodes those sounds back into the string. Then get a job with the NSA.

                      #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

                      1 Reply Last reply
                      0
                      • K Kevin Marois

                        Hey John, look what I just got[^] Gonna try it out this weekend.

                        If it's not broken, fix it until it is

                        T Offline
                        T Offline
                        TheGreatAndPowerfulOz
                        wrote on last edited by
                        #14

                        You freak! Don't you know that guns and gunsights kill our children????? How dare you use guns to entertain yourself!! You must be a blood-loving gun freak! ;P Just kidding...

                        #SupportHeForShe Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun

                        1 Reply Last reply
                        0
                        • U User 12663466

                          Hello guys, am new at coding. I was searching alot for an example an i cant find what i need. The most examples that i found, the first application executes the application 2 and passing the text. I need the Application 2 opened all the time, and i need the Application 1 send to Application 2 only the data. any help??

                          J Offline
                          J Offline
                          Jeremy Falcon
                          wrote on last edited by
                          #15

                          Don't listen to these replies, they don't know what they're talking about. If you want two apps to talk to each other, first you gotta take them out to a pub. Apps are usually shy at first, so of course you'll need to buy them a few beers*. Once they're good well and intoxicated, you should tell the first app that the second app thinks its cute. Then tell the second app the first app thinks its cute. Then you can leave, for your work is done, and the transport protocol TCP/WEEPEE version 2.0 will do the rest. * Should like like this: :beer:

                          Jeremy Falcon

                          F 1 Reply Last reply
                          0
                          • realJSOPR realJSOP

                            He could also write a Windows service that uses WCF to receive the string, encrypt it, send it to a web site which would store it in a database, and then have his other app periodically poll the web site with a WebClient object that would cause the web site to check the database for new data. Once the data is retrieved, he would then have to call another page on the web site to delete the data that was just retrieved. Then there's all the transaction processing that needs to occur, not to mention the necessity for code that makes sure the string is different from the last time he retrieved it, as well as maintaining a cache of retrieved strings to ensure no duplication has occurred. If he wants it to be configurable, he 'd have a lot more work to do as well. We haven't even GOTTEN to the act of logging everything in the system log yet.

                            ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                            -----
                            You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                            -----
                            When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                            W Offline
                            W Offline
                            Wendell D H
                            wrote on last edited by
                            #16

                            No Message Queue involved? Sounds like a half baked solution. :^)

                            1 Reply Last reply
                            0
                            • U User 12663466

                              Hello guys, am new at coding. I was searching alot for an example an i cant find what i need. The most examples that i found, the first application executes the application 2 and passing the text. I need the Application 2 opened all the time, and i need the Application 1 send to Application 2 only the data. any help??

                              P Offline
                              P Offline
                              Pete OHanlon
                              wrote on last edited by
                              #17

                              First of all, welcome to Code Project. As you have probably gathered by now from our more robust members, the lounge isn't really the place to ask programming questions; generally you would want to ask a question in a more appropriate forum such as this[^] one. I have to assume that you don't really need Application 2 open all the time; rather, you have a requirement that Application 1 isn't going to open it with the relevant data. If we accept that as true then this simplifies the problem you have to solve. Basically, what you are looking for is something called Client/Server programming, where you communicate between two separate processes using techniques such as named pipes, sockets, messaging over TCP, and so on. The problem with this type of development is that this really is a complex area - you could use something like Anonymous Pipes[^]; there's a working example in VB.NET there so that should help. Alternatively, you should search Google for examples of Client/Server programming in VB.NET[^]. I hope that this helps to give you some areas to explore.

                              This space for rent

                              M 1 Reply Last reply
                              0
                              • J Jeremy Falcon

                                Don't listen to these replies, they don't know what they're talking about. If you want two apps to talk to each other, first you gotta take them out to a pub. Apps are usually shy at first, so of course you'll need to buy them a few beers*. Once they're good well and intoxicated, you should tell the first app that the second app thinks its cute. Then tell the second app the first app thinks its cute. Then you can leave, for your work is done, and the transport protocol TCP/WEEPEE version 2.0 will do the rest. * Should like like this: :beer:

                                Jeremy Falcon

                                F Offline
                                F Offline
                                Foothill
                                wrote on last edited by
                                #18

                                I think this would work well until the two apps become overly coupled and start spawning too many child processes which become starved for resources.

                                if (Object.DividedByZero == true) { Universe.Implode(); } Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016

                                J 1 Reply Last reply
                                0
                                • realJSOPR realJSOP

                                  I have an Aimpoint Pro - the bushnell should work pretty good. I went out shooting this weekend. Spent 300 rounds. One guy wanted to buy my rifle because he liked the camo paint job. Offered me $1500 - I passed on the offer.

                                  ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                                  -----
                                  You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                                  -----
                                  When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                                  M Offline
                                  M Offline
                                  Marc Clifton
                                  wrote on last edited by
                                  #19

                                  John Simmons / outlaw programmer wrote:

                                  because he liked the camo paint job

                                  Camo couch extra? ;) Marc

                                  Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project! Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

                                  1 Reply Last reply
                                  0
                                  • F Foothill

                                    I think this would work well until the two apps become overly coupled and start spawning too many child processes which become starved for resources.

                                    if (Object.DividedByZero == true) { Universe.Implode(); } Meus ratio ex fortis machina. Simplicitatis de formae ac munus. -Foothill, 2016

                                    J Offline
                                    J Offline
                                    Jeremy Falcon
                                    wrote on last edited by
                                    #20

                                    In which case application B could limit application A's disk access to limit the exposure of copies being created being serialized.

                                    Jeremy Falcon

                                    W F 2 Replies Last reply
                                    0
                                    • P Pete OHanlon

                                      First of all, welcome to Code Project. As you have probably gathered by now from our more robust members, the lounge isn't really the place to ask programming questions; generally you would want to ask a question in a more appropriate forum such as this[^] one. I have to assume that you don't really need Application 2 open all the time; rather, you have a requirement that Application 1 isn't going to open it with the relevant data. If we accept that as true then this simplifies the problem you have to solve. Basically, what you are looking for is something called Client/Server programming, where you communicate between two separate processes using techniques such as named pipes, sockets, messaging over TCP, and so on. The problem with this type of development is that this really is a complex area - you could use something like Anonymous Pipes[^]; there's a working example in VB.NET there so that should help. Alternatively, you should search Google for examples of Client/Server programming in VB.NET[^]. I hope that this helps to give you some areas to explore.

                                      This space for rent

                                      M Offline
                                      M Offline
                                      Mycroft Holmes
                                      wrote on last edited by
                                      #21

                                      I thought the robust members were quite restrained, in days of yore they would have flamed him at the stake.

                                      Never underestimate the power of human stupidity RAH

                                      J 1 Reply Last reply
                                      0
                                      • J Jeremy Falcon

                                        In which case application B could limit application A's disk access to limit the exposure of copies being created being serialized.

                                        Jeremy Falcon

                                        W Offline
                                        W Offline
                                        Wastedtalent
                                        wrote on last edited by
                                        #22

                                        Jeez we wouldn't want this guy to create anything Viral, he's just not ready.

                                        1 Reply Last reply
                                        0
                                        • R R Giskard Reventlov

                                          Buy an envelope and stamp. Put the string in the envelope and the stamp on it. Address it to the second app. Post it. Eventually it will arrive.

                                          J Offline
                                          J Offline
                                          Johnny J
                                          wrote on last edited by
                                          #23

                                          It's not done like that anymore you twit! Nowadays, data is passed between applications using emails! :doh:

                                          Anything that is unrelated to elephants is irrelephant
                                          Anonymous
                                          -----
                                          The problem with quotes on the internet is that you can never tell if they're genuine
                                          Winston Churchill, 1944
                                          -----
                                          I'd just like a chance to prove that money can't make me happy.
                                          Me, all the time

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups