your_class_type is a placeholder for the class type, in this case CConnection.
your_class_instance is a placeholder for an instance of CConnection. I don't
know what you called it in your code.
Here is an example:
class CConnection
{
private:
HRESULT DirectPlayMessageHandler(DWORD dwMessageId, PVOID pMsgBuffer);
public:
static HRESULT WINAPI Thunk_DirectPlayMessageHandler(PVOID pvUserContext,
DWORD dwMessageId, PVOID pMsgBuffer)
{
return ((CConnection *)pvUserContext)->DirectPlayMessageHandler(dwMessageId,
pMsgBuffer);
}
// etc.
};
// in your code somewhere
CConnection * connection = new CConnection();
hr = m_pDP->Initialize((void *)&connection,
CConnection::Thunk_DirectPlayMessageHandler, 0 );
//etc.
Here's how it works:
Add to your class a static thunk method with the same signature as the DPMH but
that is static. All that this method does is simply take ther user context,
cast it to the type of your class, and then call a non-static method on that
class.
When you initialize, you pass in the address of the instance of your class that
you want to act on, connection in this case, and the address of the thunk
function.
Now, when the code is executed, the internal workings calls the thunk function
w/ the instance of your class, which is cast and makes the method call on the
full member DirectPlayMessageHandler, which has full access to all class
methods/data.
Dig?