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. write to console or output

write to console or output

Scheduled Pinned Locked Moved C / C++ / MFC
csharpc++debuggingquestion
10 Posts 4 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.
  • D Offline
    D Offline
    duta
    wrote on last edited by
    #1

    Hi there In C# is a method WriteLine in Debug class. How can I do that in a MFC win32 application.

    D T D 3 Replies Last reply
    0
    • D duta

      Hi there In C# is a method WriteLine in Debug class. How can I do that in a MFC win32 application.

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

      duta wrote:

      How can I do that in a MFC win32 application.

      Assuming a non-GUI application, try WriteConsole() or WriteConsoleOutput(). If, however, you are referring to the debug window within the IDE, check out TRACE().

      "Love people and use things, not love things and use people." - Unknown

      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

      1 Reply Last reply
      0
      • D duta

        Hi there In C# is a method WriteLine in Debug class. How can I do that in a MFC win32 application.

        T Offline
        T Offline
        toxcct
        wrote on last edited by
        #3

        first of all, it seems that you don't exactly know what you're talking about :

        duta wrote:

        in a MFC win32 application

        even though MFC is built upon Win32, an application is either MFC or Win32, not both. moreover, even though it is possible to have a console in a MFC program, it is a framework designed for window oriented applications. so to reply, but not to you exact question, you still can always use the C++ mechanisms to output to the standard stream :

        std::cout << "Hello World !";

        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        J 1 Reply Last reply
        0
        • D duta

          Hi there In C# is a method WriteLine in Debug class. How can I do that in a MFC win32 application.

          D Offline
          D Offline
          duta
          wrote on last edited by
          #4

          it's about a GUI using MFC. I'm new in the field and I wish to learn. I need so see/write some variables but without using a label.

          D 1 Reply Last reply
          0
          • D duta

            it's about a GUI using MFC. I'm new in the field and I wish to learn. I need so see/write some variables but without using a label.

            D Offline
            D Offline
            duta
            wrote on last edited by
            #5

            I find it. It's about TRACE() I'm new and main problem is because I don't know how to use MSDN efficiently.

            1 Reply Last reply
            0
            • T toxcct

              first of all, it seems that you don't exactly know what you're talking about :

              duta wrote:

              in a MFC win32 application

              even though MFC is built upon Win32, an application is either MFC or Win32, not both. moreover, even though it is possible to have a console in a MFC program, it is a framework designed for window oriented applications. so to reply, but not to you exact question, you still can always use the C++ mechanisms to output to the standard stream :

              std::cout << "Hello World !";

              [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

              J Offline
              J Offline
              Jim Crafton
              wrote on last edited by
              #6

              Actually that's not entirely correct. You can change your linker settings from /subsystem:WINDOWS to /subsystem:CONSOLE and you will get a console.

              ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog

              T 1 Reply Last reply
              0
              • J Jim Crafton

                Actually that's not entirely correct. You can change your linker settings from /subsystem:WINDOWS to /subsystem:CONSOLE and you will get a console.

                ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog

                T Offline
                T Offline
                toxcct
                wrote on last edited by
                #7

                that's why i said "even though it is possible to have a console in a MFC program", but i felt the post owner wasn't that far in learning C++/MFC...

                [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                J 1 Reply Last reply
                0
                • T toxcct

                  that's why i said "even though it is possible to have a console in a MFC program", but i felt the post owner wasn't that far in learning C++/MFC...

                  [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                  J Offline
                  J Offline
                  Jim Crafton
                  wrote on last edited by
                  #8

                  Damn you got me! :) Helps to read all the way to the end! :)

                  ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog

                  D 1 Reply Last reply
                  0
                  • J Jim Crafton

                    Damn you got me! :) Helps to read all the way to the end! :)

                    ¡El diablo está en mis pantalones! ¡Mire, mire! Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)! SELECT * FROM User WHERE Clue > 0 0 rows returned Save an Orange - Use the VCF! VCF Blog

                    D Offline
                    D Offline
                    duta
                    wrote on last edited by
                    #9

                    many thx for your posts. :) :) I've tried to switch to system:/console but I have this error: error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

                    D 1 Reply Last reply
                    0
                    • D duta

                      many thx for your posts. :) :) I've tried to switch to system:/console but I have this error: error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup

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

                      duta wrote:

                      error LNK2019: unresolved external symbol _main...

                      So do you have a main() function?

                      "Love people and use things, not love things and use people." - Unknown

                      "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                      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