#include <windows.h>
#include <tlhelp32.h>
以上是两个必须包含的头文件

解决方案 »

  1.   

    哦,对了,谢谢.可是我现在还是得不到我要的结果,我哦是想显示机子现在所运行的线程的列表,可是看不到结果!!为什么呢
    代码如下:
    if(m_nProcess!=-1) return; HANDLE snapshot=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
    if(snapshot==NULL) return; m_lisProcess.SetRedraw(FALSE);
    SHFILEINFO shSmall;
    int nIndex;
    CString str; PROCESSENTRY32 processinfo;
    processinfo.dwSize=sizeof(processinfo); BOOL status=Process32First(snapshot,&processinfo);
    while(status)
    {
    m_nProcess++;
        ZeroMemory(&shSmall,sizeof(shSmall));
    SHGetFileInfo(processinfo.szExeFile,0,&shSmall,sizeof(shSmall),SHGFI_ICON|SHGFI_SMALLICON);
    nIndex=m_imgSmall.Add(shSmall.hIcon);
    nIndex=m_lisProcess.InsertItem(m_nProcess,processinfo.szExeFile,nIndex);
    str.Format("%08X",processinfo.th32ProcessID);
    m_lisProcess.SetItemText(nIndex,1,str);
            str.Format("%08X",processinfo.th32ParentProcessID);
            m_lisProcess.SetItemText(nIndex,2,str);
    status=Process32Next(snapshot,&processinfo);
    }
    m_lisProcess.SetImageList(&m_imgSmall,LVSIL_SMALL);
    m_lisProcess.SetRedraw(TRUE);
      

  2.   

    提示的错误是"for information o how your program can cause an assertion failure,see the visual c++ documentation o asserts"
    我因为是刚学的,所以这些还不太懂,希望能予以赐教!!!
      

  3.   

    提示的错误是"for information o how your program can cause an assertion failure,see the visual c++ documentation o asserts"
    我因为是刚学的,所以这些还不太懂,希望能予以赐教!!!
      

  4.   

    不好意思,这种错误是由于某个指针指向了无效地址所致,
    单单看你的代码无法获得所要信息,你可以在程序可能出错的地方加上assert或者verify,获得错误出现的开始