Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

fopen problem.

Here's a toughy...

I have a dll, a plugin to another app. It does hard disk I/O to retrieve images to display on the screen. Usually, it works just fine. Sometimes, though, it will return a zero FILE* pointer from the fopen call, with error 24. Once it does this, it continues to do it for all subsequent calls until I kill the app and restart it.

The arguments to the fopen call are the relative pathname to the image file (uses normal "printable" ascii characters (not unicode), including '', and the string "rb". The compiler is MSVS 2004 .NET Pro, though I'm not using any .NET/MFC/whathaveyou, just standard C++ library calls and the windows SDK a'la Petzold.

Any suggestions?

Comments

  • LundinLundin Member Posts: 3,711
    : Here's a toughy...
    :
    : I have a dll, a plugin to another app. It does hard disk I/O to retrieve images to display on the screen. Usually, it works just fine. Sometimes, though, it will return a zero FILE* pointer from the fopen call, with error 24. Once it does this, it continues to do it for all subsequent calls until I kill the app and restart it.
    :
    : The arguments to the fopen call are the relative pathname to the image file (uses normal "printable" ascii characters (not unicode), including '', and the string "rb". The compiler is MSVS 2004 .NET Pro, though I'm not using any .NET/MFC/whathaveyou, just standard C++ library calls and the windows SDK a'la Petzold.
    :
    : Any suggestions?
    :


    Just guessing here.

    Spontanously, I'd say it sounds like a multi-thread related error where several threads attempt to open the same file at once. But since the problem is repeating itself, that sounds less likely.

    One could perhaps suspect that something funny is happening to the file name parameter passed to fopen(). When the error occurs, have you tried to display the filename?

    Oh, and while you write '' for the backslash here on the board, you do write '\' in your code... right?
Sign In or Register to comment.