求教:vb.net
调用MFC DLL问题 vb.net: Public Declare Function fx Lib "Analyze.dll " Alias "fenxi " (ByVal szFileName As String,ByVal appPath As String) As Integer
调用: result = fx(pathName,foder)
错误: 未处理的“System.NullReferenceException”类型的异常 其他信息: 未将对象引用设置到对象的实例 在线等待. __________________________________________________________________________ QQ:331069386 __________________________________________________________________________ vc提供的接口类型有问题吧 __________________________________________________________________________ CathySun118(斯年) : 兄弟,能不能说得详细点? __________________________________________________________________________ BOOL CAnalyzeApp::fenxi(CString szFileName,CString appPath) { //_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); BOOL result1; LONG rnum; rnum = 0; AfxMessage
Box( "start "); CAvi1* Avi1=new CAvi1(); result1 = Avi1-> ExtractAVIFrames(szFileName,appPath); AfxMessage
Box( "start1 "); if (result1 == FALSE) { AfxMessage
Box(szFileName + "视频
文件有损坏! "); //当做无人处理 return FALSE; } AfxMessage
Box( "234 "); Avi1-> OnDetectMinus(appPath); rnum = Avi1-> lReturnNum; if (rnum <= 10 ) { //无人 return FALSE; } else { //有人 return TRUE; } AfxMessage
Box( "ok "); delete Avi1; return TRUE; } __________________________________________________________________________ 这是vc里的
代码 __________________________________________________________________________ dll 里 接口
函数应定义成 _desc export BOOL CAnalyzeApp::fenxi 我记得是这样。 具体写法网上搜就行 __________________________________________________________________________ 不好意思,发错了,请高手帮忙啊 int CAnalyzeApp::fenxi(CString szFileName,appPath); AfxMessage
Box( "start1 "); if (result1 == FALSE) { AfxMessage
Box(szFileName + "视频
文件有损坏! "); //当做无人处理 return 0; } AfxMessage
Box( "234 "); Avi1-> OnDetectMinus(appPath); rnum = Avi1-> lReturnNum; if (rnum <= 10 ) { //无人 return 0; } else { //有人 return 1; } //AfxMessage
Box( "ok "); //delete Avi1; //return TRUE; } __________________________________________________________________________ CAvi1* Avi1=new CAvi1(); result1 = Avi1-> ExtractAVIFrames(szFileName,appPath); 这里错了? __________________________________________________________________________ 你直接用非托管
方法吧 __________________________________________________________________________ 兄弟,能不能说得详细点? 谁有这方面的开发经验,给指条明路啊 __________________________________________________________________________