关于InternetGetCookie参数的问题
我的调用如下
LPCWSTR szURL;
LPWSTR lpszData = NULL;
LPDWORD dwSize = 0;
szURL = L "http://localhost/TempConvert3.asmx ";
if(!InternetGetCookie(szURL, NULL, lpszData, dwSize))
....
但执行的结果返回ERROR_INVALID_PARAMETER....究竟是那个参数错了....搞不懂..
请各位帮一下忙
[解决办法]
Return Values
If the function succeeds, the function returns TRUE.
If the function fails, it returns FALSE. To get extended error data, call GetLastError.
The following error values apply to InternetGetCookie.
Return code Description
ERROR_NO_MORE_ITEMS There is no cookie for the specified URL and all its parents.
ERROR_INSUFFICIENT_BUFFER The value passed in lpdwSize is insufficient to copy all the cookie data. The value returned in lpdwSize is the size of the buffer necessary to get all the data.
所以,你用的LPDWORD dwSize = 0;不对~~~