Jump to content
Sign in to follow this  
DrJeseuss

Need help with _WinNet_GetLastError

Recommended Posts

DrJeseuss

Has anyone had experience using _WinNet_GetLastError? I'm trying to get extended error info for an FTP error I'm receiving. See my other post for details of this:

If anyone can show an example of this command's usage, or at least explain the syntax beyond what the help shows I'd greatly appreciate it! I can figure it out as the ByRefs are what I'd expect the Return values to be, but the command appears to use them as inputs, not outputs.

Share this post


Link to post
Share on other sites
AdmiralAlkex

Why do you think they are inputs?

Look at the actual code, only $iError is used in the DllCall() so it's the only one that could be an input, but if you lookup the function on MSDN, it's clearly just a output.

I don't really like how the function is written, but it should work.

Local $iErrorCode, $sErrorString, $sNetworkProvider
_WinNet_GetLastError($iErrorCode, $sErrorString, $sNetworkProvider)
MsgBox(0, "Error code is", $iErrorCode)
;etc...
Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites
DrJeseuss

Admiral,

I see my mistake with this. In my previous attempts to use this call I failed to declare the vars first and in frustration did not look closely at the error, which is ironic as I'm trying to get my own app to provide clear errors... though it appears I don't read them always. :D I'll give this a shot the next time I'm able. Thanks for the second pair of eyes!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.