C++ Builder interface

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

Moderator: Moderators

Post Reply
Mark Heaton
Posts: 9
Joined: Sat Jul 26, 2008 4:35 am
Location: Cornwall, UK

C++ Builder interface

Post by Mark Heaton »

Does anyone have an example of using SpaceNavigator in a C++ Builder project?
TAT TWAM ASI
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Not that I know of.
ngomes
Moderator
Moderator
Posts: 3347
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Post by ngomes »

Searching the forum for "builder" brings up this topic.
Nuno Gomes
Mark Heaton
Posts: 9
Joined: Sat Jul 26, 2008 4:35 am
Location: Cornwall, UK

thanks

Post by Mark Heaton »

Thanks, Gomez. I'll work through PiotreX's code and let you know how I get on.
TAT TWAM ASI
Mark Heaton
Posts: 9
Joined: Sat Jul 26, 2008 4:35 am
Location: Cornwall, UK

difficulties with C++ Builder

Post by Mark Heaton »

Dear Nuno Gomes,
I worked through all of Piotrex's code in the link you gave, but couldn't get it to work. Thinking this might have been because I was using C++ Builder Version 2007, I re-booted an old computer which had Version 6 running under XP, but found this even more complex than on Version 2007, and leading to the same sort of result as I had been getting from Version 2007. I posted a reply to Piotrex, but have had no response. Where can I go from here to get it to work? I think Piotrex's comments, although no doubt excellent guidelines for the knowledgable, assumed their reader knew what he/she was doing! As far as C++ under Windows is concerned, I'm still learning.
Regards,
Mark Heaton
TAT TWAM ASI
ngomes
Moderator
Moderator
Posts: 3347
Joined: Mon Nov 27, 2006 7:22 am
Contact:

Post by ngomes »

Hi Mark Heaton,

Unfortunately, we do not use Builder C++ and we cannot provide much help.

What we can recommend is to look-up the use of "COM servers" in the doc for Builder. The "3DxInput" API is a COM server and that technology -- a standard features of modern Windows -- is supported by Builder.
JorgenB
Posts: 1
Joined: Fri Nov 14, 2008 5:57 am
Location: Denmark

Post by JorgenB »

Hi All

Just a brief note on the creation of a C++ Builder project.

I found that the following procedure works fine for me:
1. Create a VCL project.
2. Components->Import Component->Import a Type Lib->Import 3D..->Add unit to project.
3. Convert TDxInput.dll (in 3DxWare\win32) to TdxInput.lib
4. Add the lib file to your project

Declare the following private variables in the main form header:

ISensorPtr aSensor;
TDevice* aDevice;

Then the following code work fine:
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
aDevice = new TDevice(this);
aSensor = aDevice->Sensor;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TimerTimer(TObject *Sender)
{
IVector3DPtr Translation = aSensor->get_Translation();
Label1->Caption = FloatToStr(Translation->X);
Label2->Caption = FloatToStr(Translation->Y);
Label3->Caption = FloatToStr(Translation->Z);
Label4->Caption = FloatToStr(Translation->Length);

IAngleAxisPtr Rotation = aSensor->get_Rotation();
Label5->Caption = FloatToStr(Rotation->Angle);
Label6->Caption = FloatToStr(Rotation->X);
Label7->Caption = FloatToStr(Rotation->Y);
Label8->Caption = FloatToStr(Rotation->Z);
}
//---------------------------------------------------------------------------

Nearly to simple to be true :D

Jorgen
Post Reply