   dplay, static callbacks, and user context parameters
  So, I have my game engine, and it is all wonderfully object oriented, la di da.  I go to add a direct play networking component, and find I need a static callback function for dplay to call.  My problem now is getting around that requirement.My initial thought was that I would be able to use the pvUserContext parameter in Initialize calls to store a pointer to the Client or Server object that was calling Initialize.  Then, when the callback was called, it would have a context pointer that it could use just like they keyword this, and I could just pretend it was a non-static member function, using the parameter instead of this.  I thought I would be able to do this because I read in the DX9 sdk docs that pvUserContext in the callbacks was a "Pointer to the application-defined structure that will be passed to this callback function. This is defined in the pvUserContext parameter of the Initialize method."Then, I went to another page and read that "The only place you can define a player context value is in a DPN_MSGID_CREATE_PLAYER or DPN_MSGID_INDICATE_CONNECT message handler." and further more that only Peers and Servers would use the context values, not Clients.  That seems contradictory to me, and I am very confused!If anyone can help me with a clarification of the pvUserContext paremeter in the various Initialize and callback functions, I would really appreciate it.Thanks for any help~riley 
  I believe I have figured out my problem.  There are two distinct user context values.  One is set when you call initialize, and that context is for giving the local client or server object context.  The other is set only by the server, and it is for giving the remote clients context, so that the message handler can tell who sent the message.Hope this helps someone! ;  Nice one! I was running into the same weirdness as well until I checked the SDK docs.I get frustrated sometimes because (at times) DirectPlay8 is a really usefull and cool piece of networking interface code that you can plug into your engine. But it''s also EXTREMELY annoying in other areas....Not sure why the dx team creates/rewrites the DirectPlay interfaces to deal with the clunkiness of the previous versions, then just suddenly shuts up about it. There''s bare mention of it in the MSDN (apart from the SDK docs)..They could do some network metering articles on it, or discuss efficient ways to actually use it in your engine, etc...oh well..fantasy...