Click here to Skip to main content
15,892,746 members
Articles / Desktop Programming / WTL

WinINet Test Application

Rate me:
Please Sign up or sign in to vote.
4.71/5 (29 votes)
12 Apr 2008CPOL3 min read 118.5K   4.1K   59  
A WTL application to test asynchronous WinINet functionality.
#pragma once
// This class only contains static functions.
// It is a convenient way to let any WTL window class
// inherit non-blocking wait function calls.  I like
// to use inheritance to encapsulate the calls rather
// than declaring them as global.
// These functions borrow heavily from the article
// "Using a Non-Blocking Versions of Win32 Wait Functions"
// Andy Smith July 31, 2002
// http://www.codeguru.com/cpp/w-p/win32/article.php/c4531/
class CWaitFuncs
{
public:
static DWORD WaitForSingleObject(HANDLE hHandle,DWORD dwMilliseconds);
static DWORD WaitForSingleObjectEx(HANDLE hHandle,DWORD dwMilliseconds,BOOL bAlertable);
static DWORD WaitForMultipleObjects(DWORD nCount,LPHANDLE lpHandles,BOOL bWaitAll,DWORD dwMilliseconds);
static DWORD WaitForMultipleObjectsEx(DWORD nCount,LPHANDLE lpHandles,BOOL fWaitAll,DWORD dwMilliseconds,BOOL bAlertable);
static BOOL SleepEx(DWORD dwMilliseconds, BOOL bProcessMsgs=TRUE);

};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Business Analyst Southwest Research Institute
United States United States
I am a C++ coder. I am also proficient with Oracle PL/SQL. A lot of folks dislike Oracle, but I find Oracle is a significant revenue enhancer. Customers pay for first rate Oracle programming skills.

I have extensive experience with COM+, COM, ATL, WTL and installation package development. I've developed several packages in C#, but I prefer managed/native C++. I've been coding for nearly thirty plus years, getting my start with atomic and molecular orbital calculations in FORTRAN. I've been working with C or C++ since the days of QuickC, Desmet C, Datalight C and MSC 5.1.

One of my pet peeves in life is a programmer's lack of attention to the details of error handling. Most example code I see on the internet lacks depth. No use of Window's Event Logging and a lack of understanding as to how to handle exceptions. If folks actually think about how to properly debug and test, there would be fewer "slop" articles and a lot higher quality.

Including instrumentation in your software to allow proper diagnosis of failures is far more important to a user than the latest Gee-Whiz-Bang visual effects. Graphical gotta-haves fade like the lettuce in a refrigerator, but solid programs just keep on running, no matter what environment they are placed in.

My Web Site, Blog & Wiki

Comments and Discussions