Here's my version:
str InternetGetLastResponseInfo()
{
DLLFunction getLastResponseInfo = new DLLFunction(winInetDLL, 'InternetGetLastResponseInfoA');
Binary lpdwError = new Binary(#sizeOfInt);
Binary lpszBuffer = new Binary(#length0x200);
Binary lpdwBufferLength = new Binary(#sizeOfInt);
;
getLastResponseInfo.returns(ExtTypes::DWord);
getLastResponseInfo.arg(ExtTypes::Pointer,
ExtTypes::Pointer,
ExtTypes::Pointer);
lpdwBufferLength.dWord(#Offset0,#length0x200);
if (getLastResponseInfo.call(lpdwError,lpszBuffer,lpdwBufferLength) == 0)
return StrFmt("@SYS76827", WinAPI::getLastError());
else
{
return lpszBuffer.string(#Offset0);
}
}
and it seems to work
Regards
Jan Stelsig Dahlsgaard
Fujitsu DK
________________________________
Fra: [email protected] [mailto:[EMAIL PROTECTED] P� vegne af Zappia Alessandro
Sendt: 13. juni 2005 12:58
Til: [email protected]
Emne: [development-axapta] InternetGetLastResponseInfo
Hi,
Has anyone ever tryed to implement the WinInet Api
"InternetGetLastResponseInfo"? I tried the code that you kindly gave me
to send files via FTP, but I have some trobles that I'm not able to
understand with the ftp server. Using the "by-hand" method (e.g. with
the FTP command) I don't have any problem, but when I use the windows
api, the server I'm connecting to responses with error code 12003
(extended information).
To retrieve these "extended information" I should call the
"InternetGetLastResponseInfo" API, I tryed to declare the DLLFunction,
but I'm not able to make it work! Any help? I'll be really grateful!
PS. The code for FTP works using a local-intranet machine configured as
ftp server,so it sholud be correct!
This is the declaration:
_getExtendedError = new
DLLFunction(_winInet,"InternetGetLastResponseInfoA");
_getExtendedError.returns(ExtTypes::DWord);
_getExtendedError.arg(ExtTypes::Pointer);
_getExtendedError.arg(ExtTypes::Pointer);
_getExtendedError.arg(ExtTypes::Pointer);
This is the call:
str getExtendedError()
{
int errLen=255;
int error;
binary _errBuff=new binary(errlen);
int state;
;
state=_getExtendedError.call(error,_errbuff,errlen);
return _errBuff.string(0);
}
And these are the specifics for that API
InternetGetLastResponseInfo
Retrieves the last error description or server response on the thread
calling this function.
BOOL InternetGetLastResponseInfo(
LPDWORD lpdwError,
LPTSTR lpszBuffer,
LPDWORD lpdwBufferLength
);
Parameters
lpdwError
[out] Pointer to a variable that receives an error message
pertaining to the operation that failed.
lpszBuffer
[out] Pointer to a buffer that receives the error text.
lpdwBufferLength
[in, out] Pointer to a variable that contains the size of the
lpszBuffer buffer, in TCHARs. When the function returns, this parameter
contains the size of the string written to the buffer, not including the
terminating zero.
[Non-text portions of this message have been removed]
________________________________
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> .
[Non-text portions of this message have been removed]
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

