pcweirdo
01-03-2004, 02:57 AM
gday,
i've got the below code, which is me trying to get a website. i'm working up to a http client, but for now i'm learning a little about the wininet API calls.
anyway, every time i compile i get an error from Visual C++ that there's too few parameters in InternetOpenUrlA. Any ideas on how to fix this?
#include <windows.h>
#include <wininet.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
//MessageBox(GetDesktopWindow(), "w00t!", "1337", MB_OK | MB_ICONINFORMATION);
char* buf = "";
HINTERNET hOpen;
HINTERNET hFile;
LPDWORD ret;
hOpen = InternetOpen("pat", INTERNET_OPEN_TYPE_DIRECT, " ", 0);
hFile = InternetOpenUrl(hOpen, "www.microsoft.com", NULL, 0, INTERNET_FLAG_RELOAD, 0);
InternetReadFile(hFile, buf, 1000, ret);
InternetCloseHandle(hOpen);
InternetCloseHandle(hFile);
MessageBox(GetDesktopWindow(), buf, "www.microsoft.com", MB_OK | MB_ICONINFORMATION);
return 0;
}
thanks,
-pcweirdo.
i've got the below code, which is me trying to get a website. i'm working up to a http client, but for now i'm learning a little about the wininet API calls.
anyway, every time i compile i get an error from Visual C++ that there's too few parameters in InternetOpenUrlA. Any ideas on how to fix this?
#include <windows.h>
#include <wininet.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
//MessageBox(GetDesktopWindow(), "w00t!", "1337", MB_OK | MB_ICONINFORMATION);
char* buf = "";
HINTERNET hOpen;
HINTERNET hFile;
LPDWORD ret;
hOpen = InternetOpen("pat", INTERNET_OPEN_TYPE_DIRECT, " ", 0);
hFile = InternetOpenUrl(hOpen, "www.microsoft.com", NULL, 0, INTERNET_FLAG_RELOAD, 0);
InternetReadFile(hFile, buf, 1000, ret);
InternetCloseHandle(hOpen);
InternetCloseHandle(hFile);
MessageBox(GetDesktopWindow(), buf, "www.microsoft.com", MB_OK | MB_ICONINFORMATION);
return 0;
}
thanks,
-pcweirdo.