> sqlite3_exec(pDoc->m_db,"select * from table1", sqlCallback_UpdateList, > 0, &(pDoc->m_pErrMsg));
This line shouldn't compile unless you really meant &CMainView::sqlCallback_UpdateList as the 3rd parameter. > I met no problem with win32 console application,but when it turn to MFC > in Visual C++,the same code dosen't work. What did you mean by "the same code"? Apparently code you provided will not compile without MFC. > *The error is:* > Unhandeled exception in xxx.exe(sqlite3.dll)0xC0000005 Access Violation > *More output:* > ... Do you understand that this output is useless? What would be useful is a stack trace for the error. Pavel 2009/9/28 meng wei <[email protected]>: > I met no problem with win32 console application,but when it turn to MFC > in Visual C++,the same code dosen't work. > *The error is:* > Unhandeled exception in xxx.exe(sqlite3.dll)0xC0000005 Access Violation > *More output:* > Loaded 'ntdll.dll', no matching symbolic information found. > Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic > information found. > Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL' > Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL' > Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information > found. > Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic > information found. > Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL' > Loaded 'G:\MFC\复件 SenateSystem\Debug\sqlite3.dll', no matching > symbolic information found. > Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic > information found. > Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information > found. > Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic > information found. > Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic > information found. > Loaded 'C:\WINDOWS\system32\secur32.dll', no matching symbolic > information found. > Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information > found. > Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information > found. > Loaded 'C:\WINDOWS\system32\mfc42loc.dll', no matching symbolic > information found. > Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic > information found. > Loaded 'C:\WINDOWS\system32\MSCTF.dll', no matching symbolic information > found. > Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic > information found. > Loaded 'C:\WINDOWS\system32\msctfime.ime', no matching symbolic > information found. > Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information > found. > Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic > information found. > First-chance exception in SenateSystem.exe (SQLITE3.DLL): 0xC0000005: > Access Violation. > > > *The following is my code:* > void CMainView::myUpdateView() > { > CSenateSystemDoc* pDoc = GetDocument(); > sqlite3_exec(pDoc->m_db,"select * from table1", sqlCallback_UpdateList, > 0, &(pDoc->m_pErrMsg)); > } > //CALL BACK FUNCTION > int CMainView::sqlCallback_UpdateList(void * notused, int argc, char ** > argv, char ** szColName) > { > bool bInit = true; > int i; > if(bInit) > { > int cnt=m_pList->GetHeaderCtrl()->GetItemCount(); > for (i = 0; i < cnt; i++) > m_pList->DeleteColumn(i); > m_pList->DeleteAllItems(); > > for (i = 0; i < argc; i++) > m_pList->InsertColumn(i,szColName[i],LVCFMT_CENTER,200); > bInit = false; > } > return 0; > } > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

