Jump to content
Sign in to follow this  
CoePSX

Error with InternetOpenUrl

Recommended Posts

CoePSX

I've been trying to replicate the InetGet function from AutoIt with the asynchronous mode feature for an updater program in C. Everything else is going just fine, but I got locked at the download part.

What happens is that when I use InternetOpen with the INTERNET_FLAG_ASYNC flag, the InternetOpenUrl fails. Calling GetLastError I get the error 0x3E5.

Here's the error part of the code:

void Test2 (void) {
    HINTERNET hNet;
    HINTERNET hOpen;
    char szError[512];

    hNet = InternetOpen ("Test", INTERNET_OPEN_TYPE_PRECONFIG, NULL, 0, INTERNET_FLAG_ASYNC);
    if (! hNet) {
        FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, szError, sizeof(szError), NULL);
        MessageBox (NULL, szError, "ERROR_InternetOpen", 0);
        return;
    }

    //InternetSetStatusCallback (hNet, (INTERNET_STATUS_CALLBACK) _InternetStatusCallback);

    hOpen = InternetOpenUrl (hNet, "http://www.ceramika.com.br/velocidade/index.php", NULL, 0, 0, (DWORD) szError);
    if (! hOpen) {
        FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, szError, sizeof(szError), NULL);
        MessageBox (NULL, szError, "ERROR_InternetOpenUrl", 0);
        return;
    }
}

Changing the callback function or not still gives me the same error.

Anyone knows what might be wrong with this?

EDIT: Nevermind, i found ou URLDownloadToFile. :)

Edited by CoePSX

[quote name='Valik' post='301213' date='Jan 31 2007, 10:36 PM']You seem to have a habit of putting things in the wrong place. I feel sorry for any female you attempt to have sex with.[/quote][font="Lucida Sans Unicode"][/font]

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.