Tring to integrate example into existing C++ code...

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

Moderator: Moderators

Post Reply
Dakndak
Posts: 3
Joined: Tue Jun 19, 2007 7:27 am

Tring to integrate example into existing C++ code...

Post by Dakndak »

Hi,

I am just trying out this SDK & trying to augment the current mouse-driven app with the SpaceNavigator (C++/MSVC 8.0).

Is there a better, code-minimal way to integrate the new device?

After much effort I am down to a few errors & would appreciate any help with this!

guiInteractorStyle.h(63) : error C3702: ATL is required for COM events
guiInteractorStyle.cxx(1460) : error C3731: incompatible event 'HRESULT _ISensorEvents::SensorInput(void)' and handler 'HRESULT guiInteractorStyle::OnSensorInput(void)'; event source and event handler must have the same event type
The event type of '_ISensorEvents' is 'native'.
The event type of 'vtkEarthInteractorStyle' is 'COM'.

I've got several ATL related headers included, and aI am using
[ event_receiver(com) ] prepended to my class definition. [I have tried
event_receiver(native), but just got other errors.]

It is not very clear how to integrate the sample code for a rookie. The readme.txt is fairly terse& doesn't explain (well) what classes one needs to provide. There seem to be auto-generated files, but how does one go about integrating this into a pre-existing project??

Thanks!
mbonk
Moderator
Moderator
Posts: 181
Joined: Mon Dec 04, 2006 4:06 am

Post by mbonk »

Hi Dakndak,

Without seeing your files I think

To resolve C3702 add
#define _ATL_ATTRIBUTES 1
to the guiInteractorStyle.h header file before
#include <atlbase>

To resolve C3731 add the attribute embedded_idl to the #import statement i.e. something like
#import "progid:TDxInput.Device" embedded_idl no_namespace
or
#import "TDxInput.dll" embedded_idl no_namespace

The above may require you adding
[module(name="MyApplication")];

BTW Have you downloaded the samples from the 3dconnexion site?

Markus
Post Reply