DirectInput SetProperty & DIPROP_APPDATA

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
SpookyCat
Posts: 3
Joined: Tue May 26, 2009 8:18 am

DirectInput SetProperty & DIPROP_APPDATA

Post by SpookyCat »

Hi There

Iam using DirectInput to read my spacenavigator but Iam having a problem with DIPROP_APPDATA, I use it to define an axis number and all seems to work but when I use GetProperty to check the value I set it returns -1, all other joysticks etc return the value I just set. Is this expected?

Code: Select all

DIPROPPOINTER diptr;
	diptr.diph.dwSize       = sizeof(DIPROPPOINTER);
	diptr.diph.dwHeaderSize = sizeof(DIPROPHEADER);
	diptr.diph.dwHow        = DIPH_BYID;
	diptr.diph.dwObj        = lpddoi->dwType;
	diptr.uData             = aoff + 1;

	HRESULT hr = dev->mDevice->SetProperty(DIPROP_APPDATA, &diptr.diph);

// Read it back
DIPROPPOINTER diptr1;
	diptr1.diph.dwSize       = sizeof(DIPROPPOINTER);
	diptr1.diph.dwHeaderSize = sizeof(DIPROPHEADER);
	diptr1.diph.dwHow        = DIPH_BYID;
	diptr1.diph.dwObj        = lpddoi->dwType;

	hr = dev->mDevice->GetProperty(DIPROP_APPDATA, &diptr1.diph);
On return from GetProperty the diptr1.uData member is always -1. Am I doing something wrong?
jwick
Moderator
Moderator
Posts: 3455
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Seems like a problem in DirectInput (which we have nothing to do with). It could be a difference in their implementation of MultiAxis devices vs. joysticks. Does the SetProperty return a successful return code?

Try posting on a Microsoft forum.

Please let us all know what you find out, in case we have other developers trying to use the same function.

Jim
3Dx Software Development
SpookyCat
Posts: 3
Joined: Tue May 26, 2009 8:18 am

Post by SpookyCat »

Yes SetProperty returns DI_OK as does GetProperty. I shall ask the big MS and let you know what they say.
stu9000
Posts: 1
Joined: Mon Oct 26, 2009 9:46 am

Post by stu9000 »

Did you ever find a fix for this problem?

I have exactly the same problem now.
Post Reply