函数ISHELL_CreateInstance()返回错误14
大家好,今天在学习brew文件操作的时候,调用函数ISHELL_CreateInstance()的时候,返回值为14,在AEEError.h中,该错误码是EBADPARM,为什么会发生这样的错误呢?代码如下:
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;}
case EVT_APP_START: UpStoCreateFile(pMe, "test.txt"); return(TRUE);