Click here to Skip to main content
15,891,758 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,

I'm using WinIOCallBack in EBML library to read file. My code here :
MKVFile::MKVFile(const std::string &FilePath)
{
    m_FilePath=FilePath;
    WinIOCallback *pIOCB=new WinIOCallback(m_FilePath.c_str(),MODE_READ,0);
    //Check if file is exists
    if(!pIOCB->IsOk())
    {
        printf("File doesn't exists");
        
//delete a pointer
        delete pIOCB;
        mOk=false;
        return;
    }
    else
    {
        printf("file is okies");
    }

When I debug at line 3 then receive an error :
pIOCB = 0x003a78e8 {mOk=false mLastErrorStr="The system cannot find the file specified."mCurrentPosition=14829735431805717965 ...}.

I'm trying debug but I don't understand the error derived. Can Everyone explain and fix bug for me.
Thanks
Posted
Updated 13-Jul-11 23:30pm
v2
Comments
YDaoust 14-Jul-11 5:35am    
What is the value in m_FilePath.c_str() ?
Ed Nutting 14-Jul-11 5:36am    
Quote: "The system cannot find the file specified." - pretty big clue don't you think.. It means whatever your file path is, the file it points to doesn't exist. Basically, your file path is wrong!
Chandrasekharan P 14-Jul-11 5:41am    
The file is not available in that path. Put a breakpoint on the 2nd line and check what is the value of FilePath.

1 solution

Run it through the debugger again.
Put a breakpoint on the line:
m_FilePath=FilePath;
When you get to the breakpoint, look at FilePath, and see what it contains. Then look at exactly that path, and see if the file exists. Bet it doesn't!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900