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. Streamin proc for Rich edit

Streamin proc for Rich edit

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

    Hi I have a derived Dialog. There is a member a rich edit object. I populate the rich edit from a file. In the INITDIALOG I open the file, to do the I/O I use CStdioFile. The call back procedure is not part of an Object So for both callback proc (Reading the file) and the CDoalog Opening it. To both have access to the CStdioFile object, I declare the pointer to it not any Class, but Global The code works but maybe I shouldn't be doing it this way

    D 1 Reply Last reply
    0
    • F ForNow

      Hi I have a derived Dialog. There is a member a rich edit object. I populate the rich edit from a file. In the INITDIALOG I open the file, to do the I/O I use CStdioFile. The call back procedure is not part of an Object So for both callback proc (Reading the file) and the CDoalog Opening it. To both have access to the CStdioFile object, I declare the pointer to it not any Class, but Global The code works but maybe I shouldn't be doing it this way

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Is there a question in here? Are you wanting to know if you should use a member variable vs. a global variable?

      "One man's wage rise is another man's price increase." - Harold Wilson

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

      F 1 Reply Last reply
      0
      • D David Crow

        Is there a question in here? Are you wanting to know if you should use a member variable vs. a global variable?

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        F Offline
        F Offline
        ForNow
        wrote on last edited by
        #3

        Let me ask it a different way does or rather should the stream in proc be a member of a class ? Thanks

        D 1 Reply Last reply
        0
        • F ForNow

          Let me ask it a different way does or rather should the stream in proc be a member of a class ? Thanks

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          ForNow wrote:

          should the stream in proc be a member of a class ?

          It's not required. As long as it has this signature, it won't matter. Now depending on what you want to do with the data sent to the callback function would better determine if you needed to make it a stand-alone function, or a static member of a class.

          "One man's wage rise is another man's price increase." - Harold Wilson

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

          F 1 Reply Last reply
          0
          • D David Crow

            ForNow wrote:

            should the stream in proc be a member of a class ?

            It's not required. As long as it has this signature, it won't matter. Now depending on what you want to do with the data sent to the callback function would better determine if you needed to make it a stand-alone function, or a static member of a class.

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

            F Offline
            F Offline
            ForNow
            wrote on last edited by
            #5

            Ok thanks the data just displays storage Thanks

            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