pfnSiGetEvent fails

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

Moderator: Moderators

Post Reply
jcurru
Posts: 5
Joined: Fri Apr 09, 2010 5:15 am

pfnSiGetEvent fails

Post by jcurru »

Hello.

We have recently buy the SpacePilot in order to use it together with our new geospatial software. It's up to date and the DLLs's dates are both16/02/2010.

We are using Embarcadero's C++ Builder 2010, so I had to build the debug and release versions of siapp.lib and spwmath.lib. Both compiled without errors. Both were added to the project, and everything linked perfectly.

So the application starts, calls SiInitialize() and then:

SiOpenWinInit(&oData, Handle);
hdl = SiOpen("pps", SI_ANY_DEVICE, SI_NO_MASK, SI_EVENT, &oData);

and everything goes right because hdl returns a non-null value and SpwErrorVal value is 0 (SPW_NO_ERROR)

But in my event handler something goes wrong:

SiSpwEvent event; // 3DxWare Event
SiGetEventData eData; // 3DxWare Event Data
SiGetEventWinInit(&eData, Msg.message, Msg.wParam, Msg.lParam);
if (SiGetEvent(Handle, 0, &eData, &event) != SI_IS_EVENT)
return;

The call to SiGetEvent leads me into the corresponding function into siapp.c, but the program hangs in the line

tmpRetVal = pfnSiGetEvent(hdl, flags, pData, pEvent);

which is a call to a function into siappdll.dll (I cannot run into it with the debugger). I have tried deleting the dll manually, downloading the last 3dx software version, but it doesn't work. Running the application outside the debugger this message appears:

Access violation at adress 100D6FA in module sisapp.dll. Read of adress 00080660.

Well, please help me, I need a solution because we have to make a presentation next week and we need to have the SpacePilot working.

Thanks!

The eData object values after SiGetEventWinInit is called are:
msg = 49326
wParam = 1
lParam = 0

The oData object values after the SiOpenWinInit call, are:
hWnd = :000D0616
transCtl = NULL
processID = 1243420
libFlag = 1243836
exeFile = "sä‘|Ìø\x12\0\x18\0\0\00ñŸ\00\x10\0\0\0\0\0\0\fö$Pý\f\f\x01SŽ:~¾”9~B¯:~P\r\x1D\00\x10\0\0\0\0\0\0\fö$P\0\0\0\0°\x02\0\0\0\0\0\0\x18ú\x12\0àcî\0\x16r\0P!º\0P”ù\x12\0éÓV\0àcî\0àcî\0”ù\x12\0`ù\x12\0Þ*@\0\x02\0\0\0lù\x12\0CÎV\00(W\04ù\x12\0\f\0\0\0„?\fPù\x12\0\0\0\0\0àcî\0”ù\x12\0˜ù\x12\0\x1EýA\0°>O\x01Äù\x12\0CÎV\0ÈÀW\0hù\x12\0\f\0\0\0«Ž:~\f\x10\0\0\0\0\0\0àcî\0\0\0\0\0\0\0\0\0´ù\x12\0ÒwA\0\x10ŒP\x01 Ü÷\0 Ü÷\0àcî\0€_R\x01 ú\x12\0\x05\x10%PP\x03#P>\x12%P"
jwick
Moderator
Moderator
Posts: 3418
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

A few things come to mind:

1) The siapp API has been deprecated for quite a while. We are encouraging all future development to use one of the Microsoft APIs, such as Raw Input. That being said, it is still supported and should work fine (many applications still use it). See the Standard 3D Mouse SDK on our developer site.

2) SiGetEvent needs to use the SiHdl returned from SiOpen, not the HWND passed to SiOpenWinInit. I imagine a dereference of an arbitrary number could send SiGetEvent into a tailspin.

3) Make sure the HWND passed to SiOpen is still valid and that SiGetEvent is in the event processing path of that HWND. This is where the events from the driver will be sent.
jcurru
Posts: 5
Joined: Fri Apr 09, 2010 5:15 am

It works

Post by jcurru »

Of course it works. I am a donkey! I was passing the HWND instead of the hdl...

Ok, but now you tell me something I know nothing about. Could you briefly describe "raw input" or give me a link to read about? Would it allow my app to work with any device or something like that?

Thanks a lot!
jcurru
Posts: 5
Joined: Fri Apr 09, 2010 5:15 am

Correction

Post by jcurru »

Reading my previous message I realize that, due to my poor english, there's a sentence that sounds bad (because I wrote it almost as a direct spanish translation): "Ok, but now you tell me something..." I think that in english this could sound like an "order" or something like that. In that case I apologize and correct: "Ok, but you have told me something..." Best regards.
ngomes
Moderator
Moderator
Posts: 3431
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Re: It works

Post by ngomes »

Hi jcurru,
Could you briefly describe "raw input" or give me a link to read about?
A good place to start is to check the doc in MSDN:
Raw Input. You can also check 3Dconnexion's Standard 3D Mouse SDK which includes information on this interface.
Would it allow my app to work with any device or something like that?
It allows to work with any human input device (HID) peripherals connected over USB.
Nuno Gomes
Post Reply