关于Unhandled exception in MFC Test to Dll.exe(MBTDLL): 0xC0000005: Access Violati
我写了一个dll,并用一个MFC来测试它。
当我修改了dll中的char pathfile[254]为[60]就报错指示: _mlock(_HEAP_LOCK); /* block other threads */这一行出现错误。这是vc6.0自带的DBGHEAP.h中的语句。
我的部分源码:
bool ClientDll::ProcessTIP(TIP_HEAD* tip)动态链接库 Unhandled
{
if (NULL == tip)
{
return false;
}
char pathfile[254];//我把这个文件路径字符修改为char pathfile[60]的时候就报错:
//Unhandled exception in MFC Test to Dll.exe(MBTDLL):
//0xC0000005: Access Violati
TIP_HEAD* ntip = NULL;
bool res = false;
bool exitflag = true;
switch(tip->code)
{
case TIP_CODE_HB://前台传过来的心跳请求
printf("我收到了前台心跳请求!\r\n")......;
[解决办法]
越界了?
打印出向pathfile拷贝内容时的字符串长度