[英]First-chance exception at 0x03f7111c in CEDel.exe: 0xC0000005: Access violation writing location 0x002e0364
I am getting a "First-chance exception at 0x03f7111c in CEDel.exe: 0xC0000005: Access violation writing location 0x002e0364." 我收到“ CEDel.exe中0x03f7111c的首次机会异常:0xC0000005:访问冲突写入位置0x002e0364。 error when running my code.
运行我的代码时出错。 I am currently running in debug mode, and running on an actual Win Mobile CE 6.5.3 device that is plugged into my computer.
我当前正在调试模式下运行,并且在插入计算机的实际Win Mobile CE 6.5.3设备上运行。 The top of the stack (that is not disassembly) is pointing to an if statement, and I am not sure what is causing the error.
堆栈的顶部(不是反汇编的)指向if语句,我不确定是什么导致了错误。 The project was created in MS eMbedded C++ several years ago, and I am porting it to MS Visual Studio 2008.
该项目是几年前使用MS eMbedded C ++创建的,我正将其移植到MS Visual Studio 2008。
The code is 该代码是
CDeviceFuncCursor& curs = tempDeviceFunc.GetCursor();// added for debug checks
if (((wcscmp(_wcsupr(tempDeviceFunc.GetCursor().m_szSection), _wcsupr(INI_SERVERS_SECTION)) == 0) && //INI_SERVERS_SECTION == _T("Servers")
((wcscmp(_wcsupr(tempDeviceFunc.GetCursor().m_szVariable), _wcsupr(FTP_PRIMARY)) == 0) || //FTP_PRIMARY == _T("Primary")
* (wcscmp(_wcsupr(tempDeviceFunc.GetCursor().m_szVariable), _wcsupr(SERVER_PORT)) == 0)))) //SERVER_PORT == _T("SERVERPORT")
{
CString csValue = tempDeviceFunc.GetCursor().m_szValue;
csValue = EncryptData(csValue.GetBuffer(csValue.GetLength()));
WriteProfileString(tempDeviceFunc.GetCursor().m_szSection, tempDeviceFunc.GetCursor().m_szVariable, csValue.GetBuffer(csValue.GetLength()+1));
}
The line with the * is the one being pointed to by the stack. 带*的行是堆栈所指向的那一行。
at the break point: curs.m_szSection = "APPLICATIONCONTROL", curs.m_szVariable = "AppLanguage", curs.m_szValue == "0" 在断点处:curs.m_szSection =“ APPLICATIONCONTROL”,curs.m_szVariable =“ AppLanguage”,curs.m_szValue ==“ 0”
I am not sure where to look to find the error, 我不确定在哪里可以找到错误,
I guess you have a macro 我想你有一个宏
#define SERVER_PORT _T("SERVERPORT")
in which case _T("SERVERPORT")
is a const array. 在这种情况下,
_T("SERVERPORT")
是一个const数组。
You're not allowed to modify it ( _wcsupr
modifies its argument in-place). 您不允许对其进行修改(
_wcsupr
修改其参数)。
Replace the macro with a variable: 将宏替换为变量:
TCHAR SERVER_PORT[] = _T("SERVERPORT");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.