Thread: Opening files in windows 7&8

  1. #1
    Registered User
    Join Date
    Feb 2008

    Opening files in windows 7&8


    After I upgraded my development machine and test machine to windows 7 and 8, my programs open a window (cancel, retry or ignore) when a file or disk is not found:

    FILE *fOut = fopen(.......
    if (fOut == NULL) {
    It looks that Windows pops up the retry windows before the 'if' command, and this is very annoiyed. Is there any way to say windows to work as it did in previous versions? are more people having this problem or am I the only rare person having this issue?

    P.S.: It happens to me also that signal() is not cathing crashes as in windows XP or Vista, now a window appear to notify the user about it. My signal-dedicated function does not work any longer. the same to you?

  2. #2
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Are you opening for read or for write or read/write?

    I have code on Windows 7 that fopens with read permissions to check the existence of files, and I see no messages except those that my program generates. But if you're trying to open for write a file that doesn't exist or on a drive that isn't connected, yeah that might pop something up.

    I don't know about signal(), I don't use it. But it sounds more like you're not compiling with the right options more than anything else. Maybe you haven't include'd windows.h or something correctly?

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

  3. #3
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008

    1): `SetErrorMode'

    2): You'd have to post an example of it not working.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Opening a Windows program
    By Pyroteh in forum C++ Programming
    Replies: 15
    Last Post: 02-10-2005, 06:07 PM
  2. Opening Windows from Menus
    By Goonlecker in forum Windows Programming
    Replies: 7
    Last Post: 12-04-2003, 02:45 PM
  3. opening files
    By Gil22 in forum C++ Programming
    Replies: 2
    Last Post: 03-04-2003, 05:19 PM
  4. Opening Files from c++
    By snowy101 in forum C++ Programming
    Replies: 4
    Last Post: 06-26-2002, 11:33 AM
  5. saving files/opening files
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 10-29-2001, 10:16 PM