在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);
    }

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