xbox xinput c#

Discussion in 'Programmer's Corner' started by chrisw1990, Nov 29, 2013.

  1. chrisw1990

    Thread Starter Active Member

    Oct 22, 2011
    Found this while trying to implement xbox controller...:

    iv implemented two of the ordinals mentioned, the power off and i also have guide button detect implemented..

    However, the other two ordinals are VERY useful considering my intended purpose of the guide button.
    These are XInputWaitForGuideButton and XInputCancelGuideButtonWait..
    However, i dont understand the UnKnown* punknown variable..
    its called LPVOID here:
    and LPOVERLAPPED here:

    However, both of these are c++, not c#, and i dont understand what variable they are meant to be in order to convert/implement/use them

    Please help!!
  2. chrisw1990

    Thread Starter Active Member

    Oct 22, 2011
    potential solution is to implement my own background thread and use that to essentially do what that does.. poll the button and return or wait until its pressed..
    if a secondary background thread were to be implemented, the Cancel would have to neutralise the thread..
    However, this wouldnt be strictly threadsafe from the point of view that the xbox controller might be accessed by two threads simultaneously.. hence why im trying to use these functions..
    (just thought id add this in as an after thought)