当前位置: 代码迷 >> Brew >> 函数ISHELL_CreateInstance()返回异常14
  详细解决方案

函数ISHELL_CreateInstance()返回异常14

热度:4352   发布时间:2013-02-26 00:00:00.0
函数ISHELL_CreateInstance()返回错误14
大家好,今天在学习brew文件操作的时候,调用函数ISHELL_CreateInstance()的时候,返回值为14,在AEEError.h中,该错误码是EBADPARM,为什么会发生这样的错误呢?代码如下:
C/C++ code
int UpStoCreateFile(File *pMe, const char *fname){    IFile *pIFile = NULL;    IFileMgr *pIFileMgr = NULL;    int ret;        if (!fname)    {        return -1;    }    ret = ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_FILEMGR, (void**)pIFileMgr);    if (SUCCESS != ret)    {        return -1;    }    pIFile = IFILEMGR_OpenFile(pIFileMgr, (const char*)fname, _OFM_CREATE);    if (NULL == pIFile)    {        IFILEMGR_Release(pIFileMgr);        pIFileMgr = NULL;        return -1;    }    IFILEMGR_Release(pIFileMgr);    pIFileMgr = NULL;    IFILE_Release(pIFile);    return 0;}

我是在消息处理函数中,这样调用该函数的:
C/C++ code
        case EVT_APP_START:              UpStoCreateFile(pMe, "test.txt");            return(TRUE);



------解决方案--------------------------------------------------------
ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_FILEMGR, (void**)pIFileMgr);
改成
ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_FILEMGR, (void**)&pIFileMgr);
  相关解决方案