Guess your real problem is this
Code:
someclass *sc_p = 0;
Many of the Windows API functions require a pointer to some data as parameter where they store some result. If you pass 0 or an uninitialized pointer they fail or crash.
Guess you are talking about the lpCompletionKey parameter of GetQueuedCompletionStatus.
you have to do something like this
Code:
void somefunction(ULONG_PTR * compl ) {
GetQueuedCompletionStatus( .., ..., compl, ..., ... );
}
unsigned long compl;
somefunction(& compl ); // pass a pointer to compl where GetQueuedCompletionStatus will store the CompletionKey
Anyway you cannot pass a Null pointer to some class to this kind of functions.
Kurt