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. General Programming
  3. C / C++ / MFC
  4. Strange Console App Errors

Strange Console App Errors

Scheduled Pinned Locked Moved C / C++ / MFC
questionperformancehelp
5 Posts 2 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.
  • S Offline
    S Offline
    switang
    wrote on last edited by
    #1

    I have a console app that reads and writes from a virtual comport pair. It works great when only one instance of the program is running. But when I execute another app that opens a different virtual comport pair, I get some strange errors. I have tried different (brand) virtual comport devices, resulting in the same effect. Once I enter data on the comport for the second application to read, the first app will respond erroneously. The second app fails to perform as it should as well. So my real question: Do console apps share memory space somehow? These are not threads but separate processes. Any help is appreciated. Thanks.

    Z 1 Reply Last reply
    0
    • S switang

      I have a console app that reads and writes from a virtual comport pair. It works great when only one instance of the program is running. But when I execute another app that opens a different virtual comport pair, I get some strange errors. I have tried different (brand) virtual comport devices, resulting in the same effect. Once I enter data on the comport for the second application to read, the first app will respond erroneously. The second app fails to perform as it should as well. So my real question: Do console apps share memory space somehow? These are not threads but separate processes. Any help is appreciated. Thanks.

      Z Offline
      Z Offline
      Zac Howland
      wrote on last edited by
      #2

      switang wrote:

      So my real question: Do console apps share memory space somehow? These are not threads but separate processes.

      No, but the virtual com port might be doing so.

      If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

      S 1 Reply Last reply
      0
      • Z Zac Howland

        switang wrote:

        So my real question: Do console apps share memory space somehow? These are not threads but separate processes.

        No, but the virtual com port might be doing so.

        If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

        S Offline
        S Offline
        switang
        wrote on last edited by
        #3

        I never have any problems when using terminals to connect between the comports. I'd rule out the virtual ports as the culprit. I've used two different virtual devices (com0com and VSPD). I have noticed that entering data in the input com of one app causes the other app to respond as if it received data. I'll have to try this setup on another system to rule mine out.

        Z 1 Reply Last reply
        0
        • S switang

          I never have any problems when using terminals to connect between the comports. I'd rule out the virtual ports as the culprit. I've used two different virtual devices (com0com and VSPD). I have noticed that entering data in the input com of one app causes the other app to respond as if it received data. I'll have to try this setup on another system to rule mine out.

          Z Offline
          Z Offline
          Zac Howland
          wrote on last edited by
          #4

          switang wrote:

          I never have any problems when using terminals to connect between the comports.

          What I meant was that it might create the same buffer for multiple connections. Thus, if you have 2 programs opening a virtual port to talk to each other, and then you open another instance of each program, depending on how the virtual com ports are implemented (e.g. if they are a COM service), they may be considered the same session, or may try to use the same buffers.

          switang wrote:

          I have noticed that entering data in the input com of one app causes the other app to respond as if it received data.

          So if you enter data in 1 of the apps, both the app you expect to received the data and the app you don't expect to receive it are getting it? If that is the case, it would seem to indicate what I said above (and that the virtual port isn't thread-safe).

          If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

          S 1 Reply Last reply
          0
          • Z Zac Howland

            switang wrote:

            I never have any problems when using terminals to connect between the comports.

            What I meant was that it might create the same buffer for multiple connections. Thus, if you have 2 programs opening a virtual port to talk to each other, and then you open another instance of each program, depending on how the virtual com ports are implemented (e.g. if they are a COM service), they may be considered the same session, or may try to use the same buffers.

            switang wrote:

            I have noticed that entering data in the input com of one app causes the other app to respond as if it received data.

            So if you enter data in 1 of the apps, both the app you expect to received the data and the app you don't expect to receive it are getting it? If that is the case, it would seem to indicate what I said above (and that the virtual port isn't thread-safe).

            If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac

            S Offline
            S Offline
            switang
            wrote on last edited by
            #5

            It's beginning to look like a problem with my system. If I figure something out I'll try to post. Thanks for the input.

            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