Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / a strange problem about wxFFile?

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. a strange problem about wxFFile?
#3821
Posted by: stevenlk 2004-04-13 17:51:07
wFFlie? a file already be using and show a error log,why can return the file pointer.now i hope to prohibit the log dialog showing,how can i do?

         wxFFile * fp;
   fp=new wxFFile(strPath.c_str(),"r");

   if(fp->IsOpened())
   {
      wxLogInfo("file opened");
      filesize=fp->Length();
   }
   fp->Close();
   delete fp;

the log information is "the file is used by other process".

waiting for you answer!
              thank you!!!!
                                         stevenlk
                          
Message2. Re: a strange problem about wxFFile?
#3836
Posted by: upCASE 2004-04-15 15:34:07
Hi!
Ermm, sorry but I don't quite get it.
The file is already ni use, so now what do you want to do
1. prohibit the log dialog from showing or
2. prohibit the pointer to be set since the file is in use??

1. Use a wxLogNull target to disable all logging messages.
2. You can't do that. Read the wxFFile description. It says that you will have to check with IsOpened() like you did. wxFFile will always construct a valid pointer.
upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: a strange problem about wxFFile?
#3876
Posted by: stevenlk 2004-04-19 22:17:16
that's good idea!

          thank you
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥860.00 ·
 
 
¥900.00 ·
 
 
¥810.00 ·
 
 
¥317.00 ·
 
 
¥1,370.00 ·
 
 
¥660.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0