过往的不只云烟 2017-04-04 07:47 采纳率: 100%
浏览 1431
已采纳

在mfc dll initinstance 中加了这些代码, 为什么mfcdll被加载时程序会闪退

    setlocale( LC_ALL, "chs" ); 

    CStdioFile file("客户.txt", CFile::modeRead | CFile::modeNoTruncate);
    int i = 0;
    while(file.ReadString(my[i].nystr)!=NULL)
    {
    file.ReadString(my[i].mystr);
    i++;
    }
    j=i;
    file.Close();
    for (int i = 0; i<j; i++)
    {
        my[i].nitem = InsertItem(my[i].nystr, TVI_ROOT);
        my[i].mitem = InsertItem(my[i].mystr, my[i].nitem);
    }

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-04-04 07:50
    关注

    但不调试执行你的程序,你这个有访问外部文件,这个文件是否有问题,格式和你的代码是否匹配。这都无法从你的代码上看出来。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?