请教高手:关于GetFileSaveName函数的内存泄漏问题
rom 2006-12-12 10:32:21 程序是用pb8开发
在purifyplus检查内存泄漏,发现所写程序代码中有内存泄漏现象。
反复走查代码,没有发现问题,
加调试信息,设断点,单步跟踪,
最后竟然发现pb的GetFileSaveName函数存在内存泄漏。
///////////////pb代码段
string ls_path
string ls_name
integer value
value = GetFileSaveName("报文保存", ls_path, ls_name)
messagebox("跟踪",string(value))
///////////////purifyplus中信息
ABR: Array bounds read in CompareStringW {1 occurrence}
Reading 20 bytes from 0x001b9b60 (6 bytes at 0x001b9b6e illegal)
Address 0x001b9b60 is argument #3 of CompareStringW
Address 0x001b9b60 is 216 bytes into a 230 byte block at 0x001b9a88
Address 0x001b9b60 points to a Global/LocalAlloc'd block
Thread ID: 0x1b8
Error location
CompareStringW [C:\WINNT\system32\KERNEL32.DLL]
EqualRect [C:\WINNT\system32\USER32.dll]
DialogBoxIndirectParamA [C:\WINNT\system32\USER32.dll]
GetOpenFileNameA [C:\WINNT\system32\COMDLG32.dll]
ScreenToClient [C:\WINNT\system32\USER32.dll]
ScreenToClient [C:\WINNT\system32\USER32.dll]
ScreenToClient [C:\WINNT\system32\USER32.dll]
GetWindowLongA [C:\WINNT\system32\USER32.dll]
Allocation location
LocalAlloc [C:\WINNT\system32\KERNEL32.DLL]
EqualRect [C:\WINNT\system32\USER32.dll]
DialogBoxIndirectParamA [C:\WINNT\system32\USER32.dll]
GetOpenFileNameA [C:\WINNT\system32\COMDLG32.dll]
ScreenToClient [C:\WINNT\system32\USER32.dll]
ScreenToClient [C:\WINNT\system32\USER32.dll]
ScreenToClient [C:\WINNT\system32\USER32.dll]
GetWindowLongA [C:\WINNT\system32\USER32.dll]
那位高手有空给看一看,呵呵,