我建了一个工程,(ListView).Debug下能编译能过,不能运行。

解决方案 »

  1.   

    向工程中添加了一个类CRecportCtrl.这个类在http://www.wgd123pl.ys168.com/下载
    3,CXXXView。CPP中加入
    CString GenRandInt()
    {
    int n = (rand() % 100000) + 200;
    CString str;
    str.Format(_T("%d"), n);
    return str;
    }CString GenRandDate()
    {
    COleDateTime now = COleDateTime::GetCurrentTime();
    COleDateTimeSpan span(rand() % 3650, rand() % 24, rand() % 60, rand() % 60);
    now -= span;
    return now.Format();
    }CString GenRandDbl()
    {
    CString s = GenRandInt();
    s.Insert(s.GetLength() - 2, _T('.'));
    return s;
    }CString GenRandStr()
    {
    const CString LETTERS = _T("abcdefghijklmnopqrstuvwxyz0123456789");
    const int LEN = 16; CString str;
    for (int i = 0; i < LEN; i++)
    {
    str += LETTERS[rand() % LETTERS.GetLength()];
    } return str;
    }
      

  2.   

    最好是把下载的CPP和H文件复制到工程目录下面,再进行添加文件,BUILD ALL