Server Help

Trash Talk - fopen() with vista

hellzlaker - Fri Nov 07, 2008 11:05 am
Post subject: fopen() with vista
I write any files in vista using fopen() is there something you need to different for vista?



this is how i used fopen...(worked with xp)
Code: Show/Hide

    bool run=true;
    FILE* f;
   
    while(run)
    {
              if(!(f=fopen("file.txt","w")))
              {
                                                MessageBox(0,"Can't write to file.txt","file.txt",0);
                                                return 0;
              }

Samapico - Fri Nov 07, 2008 11:08 am
Post subject:
should work with Vista as well.

I think fopen would even work on Linux. It's a pretty standard IO operation
Adam01 - Fri Nov 07, 2008 12:23 pm
Post subject:
Does the file.txt exist? I think you need to use W+.
What library is MessageBox() in?
Isnt this c#?
hellzlaker - Fri Nov 07, 2008 1:41 pm
Post subject:
i got it to work, vista was blocking it i guess, anyway to adam01 its c++ and MessageBox() is in windows.h
Samapico - Fri Nov 07, 2008 1:55 pm
Post subject:
Vista has that DEP thing or something that prevents programs from writing in places such as Program Files
JoWie - Fri Nov 07, 2008 5:22 pm
Post subject:
Doesn't vista redirect it to a different folder
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group