Page 2 of 2

Posted: Sun Mar 27, 2005 12:41 pm
by mopopo
Prior to discussing asynchronous operations over the Internet, let's touch on one important part of data transferring. Regardless of the established session type (synchronous or asynchronous), users of your application probably will appreciate it if it somehow indicates that lengthy operations are advancing and still alive. WinInet provides a callback mechanism for such purposes. An application may register such a callback to retrieve asynchronous notifications about the desired operation's progress. You should use the following function:

typedef void (CALLBACK *INTERNET_STATUS_CALLBACK) (
HINTERNET hInternet,
DWORD_PTR dwContext,
DWORD dwInternetStatus,
LPVOID lpvStatusInformation,
DWORD dwStatusInformationLength
);

INTERNET_STATUS_CALLBACK WINAPI InternetSetStatusCallback(
HINTERNET hInternet,
INTERNET_STATUS_CALLBACK lpfnInternetCallback
);

InternetSetStatusCallback takes a pointer to the application-defined function, which then is called by WinInet when progress is made on the specified operation. Saying it briefly, all you need to do is to define the following function:

void CALLBACK YourInternetCallback(
HINTERNET hInternet,
DWORD_PTR dwContext,
DWORD dwInternetStatus,
LPVOID lpvStatusInformation,
DWORD dwStatusInformationLength
);

All parameters are described in detail in online documentation, so we won't copy it here. Let's just highlight several useful points. The second parameter of the callback function is an application-defined context for the hInternet handle. This gives you a convenient way to implement different behavior for each context value; for example, for uploading and downloading data. Another thing to be noted is the dwInternetStatus parameter. You will use its values to inform the user about actual operation progress and to detect the moment when the asynchronous operation is completed. Thus, such a callback may look like the following:

void CALLBACK InternetCallback(HINTERNET hInternet,
DWORD_PTR dwContext,
DWORD dwInternetStatus,
LPVOID lpvStatusInformation,
DWORD dwStatusInformationLength)
{
switch (dwContext)
{
case X:
...
switch (dwInternetStatus)
{
...
case INTERNET_STATUS_CONNECTED_TO_SERVER:
// Notify the user...
...
break;
case INTERNET_STATUS_REQUEST_COMPLETE:
// Asynchronous request was completed
...
break;
case INTERNET_STATUS_RESPONSE_RECEIVED:
// Process this event...
...
break;
...
}
break;
}
}

The Compact Framework still does not provide the same mechanism as C++ does, but we will see what C# offers for asynchronous calls in the next section.

This is a code ok? i know c++ now shut the **** up you fatuous poser

Posted: Sun Mar 27, 2005 12:51 pm
by live2board
http://www.developer.com/net/cplus/article.php/3436841
nice try buddy. and don'y tell me you wrote that because I know you didn't. You should've atleast changed the text so it would've been harder than a google search. Especially when its the first site that comes up.

Posted: Sun Mar 27, 2005 7:41 pm
by Cheech|N|Chong
live2board wrote:http://www.developer.com/net/cplus/article.php/3436841
nice try buddy. and don'y tell me you wrote that because I know you didn't. You should've atleast changed the text so it would've been harder than a google search. Especially when its the first site that comes up.
lmmfao...d.amn
maybe he'll get fined for claiming its his work ? maybe its

Posted: Mon Mar 28, 2005 12:28 pm
by mopopo
did i say i wrote that? NO. i said it was an example of a code i understood. if i wanted to i could show you a total 100% my code example and you can search the internet for a day and you wont find anything. though your conviction is true there is some truth in your fiction and some fiction in your truth.

Posted: Mon Mar 28, 2005 4:58 pm
by live2board
post it than. Nobody is holding you back. Show us your mad C++ programming skillz. Because we all know your a l33t haxx0rz!

Posted: Mon Mar 28, 2005 5:19 pm
by kyboren
Lmao.

I wasn't trying to insult you, I was just calling you on your outrageous claims. There comes a time when you just have to move on. That's what I'm doing right now. Hopefully I'll see you again soon somewhere and we can chat again.

Posted: Mon Mar 28, 2005 10:14 pm
by mopopo
wow look what a hello world program created lol. no hard feelings :)

Posted: Thu Mar 31, 2005 3:39 pm
by phantom48
what? i got DEV-C++ and it says it needs the make file thing, where do i get that? and where do i put it. post links please! :wink:

Posted: Sat Apr 02, 2005 3:39 am
by kyboren
How about
1) You be more specific
2) Create a thread with a topic pertinent to what you are discussing
3) You do a little thinking and research on your own, and at least TRY to solve your own problems instead of having other people spoon feed you...

Posted: Mon Apr 18, 2005 1:45 am
by kaptainkommie
[Locked]

Posted: Mon Apr 18, 2005 8:36 am
by Locke
kaptainkommie wrote:[Locked]
***Notices KK didnt lock it
*Locks