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. fprintf allowed in main dialog?

fprintf allowed in main dialog?

Scheduled Pinned Locked Moved C / C++ / MFC
c++debuggingquestion
3 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.
  • R Offline
    R Offline
    rmnowick
    wrote on last edited by
    #1

    All, I'm trying to do basic file I/O within the main dialog routine, the routine that all the GUI window notifications (WM_TIMER, etc.) are sent to. Is this allowed? The reason I ask is because when I try running the code I get a "Debug Assertion Failure" that states: File: fprintf Line: 56 Expression: Str != NULL I'm pretty new to Visual C++ so it may be that I just can't do file I/O there... Robert

    R 1 Reply Last reply
    0
    • R rmnowick

      All, I'm trying to do basic file I/O within the main dialog routine, the routine that all the GUI window notifications (WM_TIMER, etc.) are sent to. Is this allowed? The reason I ask is because when I try running the code I get a "Debug Assertion Failure" that states: File: fprintf Line: 56 Expression: Str != NULL I'm pretty new to Visual C++ so it may be that I just can't do file I/O there... Robert

      R Offline
      R Offline
      rmnowick
      wrote on last edited by
      #2

      When I go into the debugger the first argument to fprintf *str is apparently null. But, I don't open the file until a button on the GUI is pressed. The file name is based on the time that the button is hit. After opening the file I call SetTimer to fire every second at which time I try to write to the file. So, I wouldn't think that I would be writing to the file until the global variable FileOut2 gets set...

      D 1 Reply Last reply
      0
      • R rmnowick

        When I go into the debugger the first argument to fprintf *str is apparently null. But, I don't open the file until a button on the GUI is pressed. The file name is based on the time that the button is hit. After opening the file I call SetTimer to fire every second at which time I try to write to the file. So, I wouldn't think that I would be writing to the file until the global variable FileOut2 gets set...

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

        So what happens first, fopen() or fprintf()?


        A rich person is not the one who has the most, but the one that needs the least.

        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