Click here to Skip to main content
16,006,341 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WaitForSingleObject Pin
Cedric Moonen19-Oct-06 20:59
Cedric Moonen19-Oct-06 20:59 
GeneralRe: WaitForSingleObject Pin
LiYS19-Oct-06 21:17
LiYS19-Oct-06 21:17 
GeneralRe: WaitForSingleObject Pin
Cedric Moonen19-Oct-06 22:31
Cedric Moonen19-Oct-06 22:31 
Questionhow to resolve this issue? Pin
gentleguy19-Oct-06 20:13
gentleguy19-Oct-06 20:13 
AnswerRe: how to resolve this issue? Pin
ThatsAlok19-Oct-06 20:19
ThatsAlok19-Oct-06 20:19 
AnswerRe: how to resolve this issue? Pin
Cedric Moonen19-Oct-06 20:29
Cedric Moonen19-Oct-06 20:29 
AnswerRe: how to resolve this issue? Pin
David Crow20-Oct-06 3:40
David Crow20-Oct-06 3:40 
QuestionTwo Joystick and DirectInput Pin
akira3219-Oct-06 18:33
akira3219-Oct-06 18:33 
I want to write a game program can support two joystick(USB head)
Now I success to control player one's joystick.
But how to I control player two's joystick.
What I should set DirectInput to support two joystick?
Do any webs have any sample or book mentioned it?

My Source Code as below:
case JOYSTICK:
if(FAILED(m_Input->GetDirectInputCOM()->EnumDevices(DI8DEVCLASS_GAMECTRL, EnumJoysticks, this, DIEDFL_ATTACHEDONLY)))
return FALSE;
if(m_pDIDevice == NULL)
return FALSE;
DataFormat = (DIDATAFORMAT*)&c_dfDIJoystick;
break;

// Set the windowed usage
m_Windowed = Windowed;

// Set the data format of keyboard
if(FAILED(m_pDIDevice->SetDataFormat(DataFormat)))
return FALSE;

// Set the cooperative level - Foreground & Nonexclusive
if(FAILED(m_pDIDevice->SetCooperativeLevel(m_Input->GethWnd(), DISCL_FOREGROUND | DISCL_NONEXCLUSIVE)))
return FALSE;

// Set the special properties if it's a joystick
if(Type == JOYSTICK) {
// Set the special properties of the joystick - range
DIprg.diph.dwSize = sizeof(DIPROPRANGE);
DIprg.diph.dwHeaderSize = sizeof(DIPROPHEADER);
DIprg.diph.dwHow = DIPH_BYOFFSET;
//DIprg.diph.dwHow = DIPH_BYID;
DIprg.lMin = -1024;
DIprg.lMax = +1024;

// Set X range
DIprg.diph.dwObj = DIJOFS_X;
if(FAILED(m_pDIDevice->SetProperty(DIPROP_RANGE, &DIprg.diph)))
return FALSE;

// Set Y rangine
DIprg.diph.dwObj = DIJOFS_Y;
if(FAILED(m_pDIDevice->SetProperty(DIPROP_RANGE, &DIprg.diph)))
return FALSE;

// Set the special properties of the joystick - deadzone 12%
DIpdw.diph.dwSize = sizeof(DIPROPDWORD);
DIpdw.diph.dwHeaderSize = sizeof(DIPROPHEADER);
DIpdw.diph.dwHow = DIPH_BYOFFSET;
DIpdw.dwData = 128;

// Set X deadzone
DIpdw.diph.dwObj = DIJOFS_X;
if(FAILED(m_pDIDevice->SetProperty(DIPROP_DEADZONE, &DIpdw.diph)))
return FALSE;

// Set Y deadzone
DIpdw.diph.dwObj = DIJOFS_Y;
if(FAILED(m_pDIDevice->SetProperty(DIPROP_DEADZONE, &DIpdw.diph)))
return FALSE;

Questionis this the only way to do OLEDB coonection Pin
With_problem19-Oct-06 16:36
With_problem19-Oct-06 16:36 
AnswerRe: is this the only way to do OLEDB coonection Pin
Mark Salsbery19-Oct-06 17:55
Mark Salsbery19-Oct-06 17:55 
Question[question] Inheritance and access level Pin
w2520n252019-Oct-06 16:24
w2520n252019-Oct-06 16:24 
AnswerRe: [question] Inheritance and access level Pin
Mark Salsbery19-Oct-06 18:05
Mark Salsbery19-Oct-06 18:05 
QuestionDirect3D image scramples when the screensaver comes up Pin
lastgen19-Oct-06 15:39
lastgen19-Oct-06 15:39 
QuestionI need help,who can help me of this project? Pin
alphaxz19-Oct-06 15:32
alphaxz19-Oct-06 15:32 
AnswerRe: I need help,who can help me of this project? Pin
Hamid_RT19-Oct-06 20:55
Hamid_RT19-Oct-06 20:55 
Questionrealtime Redirection Pin
rupert_durans19-Oct-06 15:22
rupert_durans19-Oct-06 15:22 
QuestionRe: realtime Redirection Pin
David Crow20-Oct-06 3:43
David Crow20-Oct-06 3:43 
QuestionA real beginner Q Pin
Ray_mond19-Oct-06 10:00
Ray_mond19-Oct-06 10:00 
AnswerRe: A real beginner Q Pin
Zac Howland19-Oct-06 10:14
Zac Howland19-Oct-06 10:14 
AnswerRe: A real beginner Q Pin
Christian Graus19-Oct-06 10:17
protectorChristian Graus19-Oct-06 10:17 
QuestionStruct(ures) pointers - how to initialize? Pin
Vaclav_19-Oct-06 8:47
Vaclav_19-Oct-06 8:47 
AnswerRe: Struct(ures) pointers - how to initialize? Pin
David Crow19-Oct-06 8:50
David Crow19-Oct-06 8:50 
GeneralRe: Struct(ures) pointers - how to initialize? Pin
Vaclav_19-Oct-06 9:14
Vaclav_19-Oct-06 9:14 
GeneralRe: Struct(ures) pointers - how to initialize? Pin
Zac Howland19-Oct-06 9:49
Zac Howland19-Oct-06 9:49 
AnswerRe: Struct(ures) pointers - how to initialize? Pin
Christian Graus19-Oct-06 9:02
protectorChristian Graus19-Oct-06 9:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.