FILE *stream; CString ss;
ss = GetAppPath() + "yy\\bing" + TXT_Num + ".jpg";
if (stream = fopen(ss, "w"))
{
fwrite(buffer, sizeof(unsigned char), sizeof(buffer), stream);
fflush(stream);
fclose(stream);
}
Sleep(1500);
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Error!
Module: E:\wangyoua\dll.dll
File: e:\wangyou\dhh\bc\dll\ma.cpp
Line: 4803Run-Time Check Failure #2 - Stack around the variable 'ss' was corrupted.(Press Retry to debug the application)
---------------------------
终止(A) 重试(R) 忽略(I)
---------------------------
这个错误怎么解决
ss = GetAppPath() + "yy\\bing" + TXT_Num + ".jpg";
if (stream = fopen(ss, "w"))
{
fwrite(buffer, sizeof(unsigned char), sizeof(buffer), stream);
fflush(stream);
fclose(stream);
}
Sleep(1500);
---------------------------
Microsoft Visual C++ Debug Library
---------------------------
Debug Error!
Module: E:\wangyoua\dll.dll
File: e:\wangyou\dhh\bc\dll\ma.cpp
Line: 4803Run-Time Check Failure #2 - Stack around the variable 'ss' was corrupted.(Press Retry to debug the application)
---------------------------
终止(A) 重试(R) 忽略(I)
---------------------------
这个错误怎么解决
{
CString strPath;
char cCurrentFilePath[255];
int nTemp; GetModuleFileName(NULL, cCurrentFilePath, 255); strPath = cCurrentFilePath;
nTemp = strPath.ReverseFind('\\');
strPath = strPath.Left(nTemp+1); return strPath;
}这个就是 不会吧~
CString ss;
ss = GetAppPath() + "yy\\bing" + TXT_Num + ".jpg";
改这样CString ss;
ss.Format("%s%s%s%s", GetAppPath(), "yy\\bing", TXT_Num, ".jpg");
错误在这句
CString GetAppPath()
{
CString strPath;//这个已经被析构,不能再+字符串
}