I'm attempting to write a 'C' wrapper to COM...

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

Moderator: Moderators

Post Reply
Zekaric
Posts: 3
Joined: Fri May 04, 2007 4:37 pm
Location: Vancouver, BC
Contact:

I'm attempting to write a 'C' wrapper to COM...

Post by Zekaric »

I'm trying to get the SpacePilot and SpaceNavigator to work with our product but I'm a little stuck on a 'C' wrapper. Our product has some legacy issues and 'C' is the easiest way to hook things in. The project currently, a little rough, is here...

c wrapper lib

I'll have to admit, I'm not that versed in ATL/COM stuff either and when I compile (VS2005) the above project I get the following errors (There are more than just the one listed but they are the same.)

Code: Select all

1>c:\pmin\mtl\libastronaut\libastronaut.cpp(188) : error C3723: '_ISimpleDeviceEvents::DeviceChange': could not resolve event
1>        c:\pmin\mtl\libastronaut\debug\tdxinput.tlh(316) : see declaration of '_ISimpleDeviceEvents::DeviceChange'
1>        The event handler is one of:
1>        c:\pmin\mtl\libastronaut\libastronaut.cpp(69): could be 'HRESULT EventHandler::OnDeviceChange(long)'
1>        There are no events:
1>        c:\pmin\mtl\libastronaut\debug\tdxinput.tlh(316):  'HRESULT _ISimpleDeviceEvents::DeviceChange(long)': is not an event
...
I'm wondering if anyone knows what the problem is and how I might be able to fix it.

Thanks.
- Robbert de Groot (AKA: Zekaric)
Zekaric
Posts: 3
Joined: Fri May 04, 2007 4:37 pm
Location: Vancouver, BC
Contact:

Post by Zekaric »

Sorry for the casual viewer who doesn't want to download the zip. I'm trying to __hook() in an event. (__unhook() also.)
- Robbert de Groot (AKA: Zekaric)
jwick
Moderator
Moderator
Posts: 3339
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Zekaric,

It may be easier for you to use the old COM-less SDK. It is just C. It can be downloaded in the Archive section after you select your device type.

Jim
3Dx Software Development
Zekaric
Posts: 3
Joined: Fri May 04, 2007 4:37 pm
Location: Vancouver, BC
Contact:

Post by Zekaric »

jwick wrote:Hi Zekaric,

It may be easier for you to use the old COM-less SDK. It is just C. It can be downloaded in the Archive section after you select your device type.

Jim
3Dx Software Development
Ok. My only concern with this route is if 3dconnexion will abandon the 'C' library at a future date and leave us hanging. We've hit something like that before with another vendor. Something we'd not like to have repeated.

But I'll try the COM-less SDK instead. Thanks.
- Robbert de Groot (AKA: Zekaric)
jwick
Moderator
Moderator
Posts: 3339
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Zekaric,

There are far too many ISVs using the C SDK for us to abandon it.
You can download it from support>driver downloads->pick your device->archive.

Jim
3Dx Software Development
Camael
Posts: 9
Joined: Fri Jan 04, 2008 6:12 pm

Post by Camael »

Hi,

I've tried to write my application using the COM api so far and now I have the same output about the event not being resolved as above. Is there any mayor case for this to happen? Are there any specific project settings/defines that have to be taken? Or does it even only work when the project is created with the ATL-wizard?

What I realized is, that the generated tdxinput-interface file for my project doesn't declare the parameters of DeviceChange as [in] (I'm not THAT experienced with this topic, so I don't know if this is important).

Thanks in advance,
Joachim
mbonk
Moderator
Moderator
Posts: 181
Joined: Mon Dec 04, 2006 4:06 am

Post by mbonk »

Hi,

I couldn't download the c wrapper lib: doesn't seem to exist anymore.

Nonetheless have a look at this viewtopic.php?t=1251
I think you may be having issues with the attributes.

Markus
Camael
Posts: 9
Joined: Fri Jan 04, 2008 6:12 pm

Post by Camael »

Right, and I also forgot to add the " embedded_idl"-switch in the #import-statement. Works now - thanks.

Regards,
Joachim
Post Reply