C# Example compilation issue - missing something

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

Moderator: Moderators

Post Reply
PowderGoblin
Posts: 25
Joined: Thu Dec 18, 2008 11:41 am

C# Example compilation issue - missing something

Post by PowderGoblin »

jwick posted a nice C# example.
At compilation I am getting 'TDXInput' could not be found.
Unit - SpaceNavigator
All software installed. Test software functional.
I can see C:\Program Files\3Dconnexion\3Dconnexion 3DxSoftware\3DxWare64\
Running XP Pro x64
Visual Studio 2005
Added the DLL to the References pointing to ...\win64
Also tried ...\x32
Also tried copying the DLL in the \bin\debug\ directory.
TDxInput.dll shows in the references but with yellow exclamation mark.
Project does not compile.

I see many people are referring to this sample project - many thanks for any advice!
PowderGoblin
Posts: 25
Joined: Thu Dec 18, 2008 11:41 am

A find - for whateve it is worth

Post by PowderGoblin »

I found this old 2004 link but it seems to have some relevant info. This may be of interest to the 3DConnexion developers - maybe a clue maybe not.
http://connect.microsoft.com/VisualStud ... kID=106099
PowderGoblin
Posts: 25
Joined: Thu Dec 18, 2008 11:41 am

So close yet so far

Post by PowderGoblin »

Hi there - never mind the previous link - still cool to scan.
Is it possible that the TDxInput.dll is an MFC DLL and needs to be addressed differently from a C# project? Let's say by us writing our own C# wrapper like
[DllImport(@"\TDxInput.dll", EntryPoint = "????")]
public static extern long ????( some input parameters);

In this case are there any C# wrappers 3Dconnexions can offer as a sample that shows entry points, calling parameters etc?
PowderGoblin
Posts: 25
Joined: Thu Dec 18, 2008 11:41 am

Maybe an idea

Post by PowderGoblin »

Hi there,
I see many people are looking into this - lets assume only 1/3 are interested. This makes a good chunk of people worth helping.
If there was a location on the forum I missed which has all the answers somebody would have mentioned it by now - I am new to the forum, so that is possible.

Firm believer in helping the forum help you I publish my endeavors - for whatever it's worth.

I figured - 3DX publishes the demo EXE's. As these have no other purpose but getting clients on their wagon I though - well these might not be protected. Good idea - so I took the Jet.EXE and tried to decompile it. Sure enough - I could not - it is well protected.

That is nothing bad - probably the whole build process is channeled via the protection layer so everything gets obfuscated before release. Again - no problem. The thing is - why am I doing all this? Well, I am doing it because I did not find (or I do not know yet where to look) a set of VS2005 projects which are offered by the company in a zip file to developers. You unzip, click on the SLN file and you are DONE! Every company offers this. Go open anything DirectX SDK related - it is stuffed with sample projects.

3DX developers have about a ton of sample projects which can be shared - again, I am new and I apologize if I missed the location. If that is the case I am sure somebody will mention it.

About C# wrappers - One can be put out in one hour starting from scratch - as long as you are a 3DX developer. It is really good business, puts people at ease. Sure - who's going to support it? - would be the corporate question.
Answer - you don't have to. Look at the desperate sucking sound around the RBC9 driver. Does it have corporate support - no, it does not. People will take ANYTHING at this point and be HAPPY - I already apologized for not knowing if there are such demo projects - so I will stop doing it :)

btw. - I could not know which download location should I use for the latest RBC9 driver - many thanks if somebody mentions it.

Release something without support - tells us "Here, take this and shut up - and no support for you" - fine with me!

I read this and it sounds common sense to me - just a recipe for doing good business - get the masses hooked at no cost.

Btw - now that I mentioned it - can you guys share what you use for protection of your assemblies? Just curious. I was looking for affordable protection solutions - tested several - picked one.
For the forum members - for whatever it is worth - I use EZIRIZ. Just in case you are looking for licensing and protection - love it so far especially for protecting games. Just be warned - protecting the SDK DirectX samples as training or if you coded something based on them will make it puke - but changing two lines in the samples code will make it good again.

I wrote my own licensing at first - loved my own and felt pretty cool to fingerprint hardware etc but too much work :) - so I decided to drop wasting time ...

Ok, Ok - I used the Lutz Roeder's Reflector to try to decompile - now you have it all :)
PowderGoblin
Posts: 25
Joined: Thu Dec 18, 2008 11:41 am

comment

Post by PowderGoblin »

Oh well - early morning here - just to be specific - under "you guys" I meant at all times 3Dconnexions - not the forum guys. Not very clear from the text. Anyway - many thanks for any compilable projects for C#. Yep - again I meant "you guys" :))
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hello PowderGoblin,

Do we care about our potential developers? Well, I'm on Christmas break, sitting on my couch, on Saturday morning, answering your post. What do you think?

Jet.exe is written in C. It uses our "old" SDK (C/C++/Win32/MFC). I wrote it so many years ago, I can't even recall the time or place. I suggested distributing the source code for it, but my employees at the time were so aghast at the state of the src code (many fingers had entered, few had left cleanly) they refused, and wrote their own demo code. If you want that demo code, it is in the "3DxWare SDK" on the web site under Archives. It's probably not much use to you if you are a managed programmer.

As to the C# code, I wrote that too. I think that took less than the hour you predicted. All I did was import the assembly and use it. Note that it is a COM DLL, not a managed assembly, not a C/MFC DLL. Make sure you import it from the right menu. The fellow who wrote 3DxInput points out that I am not showing the rotations being handled correctly, and he is right. You need to use the angleaxis, not the components...but I was just writing the values out not using them for a calculation.

I think there are a couple of C++ solutions (VS2005) in the "new" SDK on the web site. Cube3D or something like that. The only C# code is the code posted inside the forum. I need to move that off to the ftp site so I can fix it and add more examples, and include the sln. There are other examples, XNA, HID, DirectInput, RawInput on the ftp site (referenced in the forum).

We don't obfuscate our assemblies. In fact, I don't think we are distributing any assemblies at this time.

Anything else I didn't answer, let me know. I'll be watching the forum all through the holidays.

Please keep posting your results. As you've noticed, a lot of people read the forum. The more the better. The better the info, the more will benefit.

Jim
3Dx Software Development
PowderGoblin
Posts: 25
Joined: Thu Dec 18, 2008 11:41 am

Many thanks

Post by PowderGoblin »

I think you just won me over :)
Your response is factual, addresses the questions an comes on a weekend ...

In all honesty - I was not thinking about the season. Indeed - many people would be on a Christmas break - go figure ... :). Well I set the Chrismas tree already but that's about it ... Oh well ... yes, I do have a life but only when it snows - PowderGoblin you know :)

I did already try what you suggested - this is why I posted the question.
I will write the description of the problem here ONLY !!!! PLEASE !!!! DO NOT work on this before Monday, or whenever you come back from a break. I do mean it - I value your time, your product and your support - I mean it. If somebody else has tips - shoot. After I solve the issue with the help of whoever pitches in I will post the summary here.

So - here we go.
1. Open Visual Studio 2005 - C# flavor
2. Open New Project - Windows Application Template
3. After the project opens - do only:
- References, Right Click, Add Reference
4. Go to the COM tab and add:
- 3Dconnexion TDxInput 1.0 Type Library
- C:\Program Files\...\3DxWare64\win32\TDxInput.dll
Highlight, Click OK
5. Reference adds with a Yellow exclamation mark.
6. Don't do anything else - just compile. Two warnings occur:
- The referenced component 'TDxInput' could not be found
- Cannot find wrapper assembly for Type Library 'TDxInput'

Going forward and using the posted in this forum C# examples will predictably cause compilation error at all places the DLL is called.

I like German efficiency so let's see:
1. We get a C# project that compiles.
2. 3DX creates a new directory in their ...\3DxWare64 which is called "Sample Projects"
3. We put the project there
4. You NEVER have to answer similar post again :)
5. Forum community contributes and this directory grows to a wonderful set of no-brainer jump-start projects.
6. This triggers a viral distribution of your products
7. 3DX developers go and buy their firs Porshe

Hope it sounds like a plan.

Btw. Merry Christmas , Frohe Weihnachten etc. to all weekend readers :)
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

You are importing the 64-bit DLL, right? (win64 subdir, not win32)
PowderGoblin
Posts: 25
Joined: Thu Dec 18, 2008 11:41 am

next

Post by PowderGoblin »

There is only one reference that shows on the COM tab and points to
C:\Program Files\3Dconnexion\3Dconnexion 3DxSoftware\3DxWare64\win32

Now - I am running XP x64 - but that should not matter much (most of the time) Never the less - Using the Browse-Tab I also tried to add the one in the \win64 directory - same issue.

I also reset the Proj properties to specifically point at x86 CPU - predictably it did not have any effect. I do not think it is the Platform Properties in the Configuration Manager though.
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Sorry it took so long. I had to find an x64 machine then install Visual Studio 2005.

Sure enough you are absolutely correct. It appears the 64-bit TDxInput is not being registered correctly. I even tried registering it manually and it didn't show up. You must have been the first to have tried it.

I'll send a msg to the responsible developer (but I don't expect a response for a while).

Thanks for pointing this out. It's nice to find these things early(ier).

Jim
3Dx Software Development
PowderGoblin
Posts: 25
Joined: Thu Dec 18, 2008 11:41 am

Wow

Post by PowderGoblin »

Speechless ... I am speechless!!!
JWICK - whoever you are - I respect you.
Also - I will not (ever) post comments on a weekend.

When you work on that issue though - I just want to mention. My development PC is x64 but I do develop for 32-bit (more common).
To set it (that is for the forum readers):
Solution Explorer - Solution - R Click - Properties - Configuration Properties - button Configuration Manager - Platform DropDown - New - x86.

This is to say that I do not insist on a x64 Driver. x86 is perfectly fine as long as I can compile.

To show my appreciation I will leave it at your discretion to decide when to contact me - I will not bother you with "Are we there yet".

Feel free to send me a private message and use me as tester until a final solution is found.

Btw. For whatever it is worth - maybe the C# wrapper you mentioned is going to compile fine.

Thank you so much JWICK ...
jwick
Moderator
Moderator
Posts: 3341
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hey no problem man. It's my job. And you got me curious as to why it didn't work.
Unfortunately, we automatically install the x64 version on x64 (we also install the x86 version too, as you see). It may have something to do with the x64 version of VS2005. It works fine on an x86 machine. Go figure.

We'll figure it out and let you know (right after we tar and feather the QA guy <G>).

Have a good holiday.
PowderGoblin
Posts: 25
Joined: Thu Dec 18, 2008 11:41 am

No rush - but any estimate?

Post by PowderGoblin »

Hi JWICK,

No rush on this one - but to help me plan my dev cycle - any estimate on when do you see this problem fixed?

Many thanks and Happy New Year!
mbonk
Moderator
Moderator
Posts: 181
Joined: Mon Dec 04, 2006 4:06 am

Post by mbonk »

I believe the best way to go about using TDxInput in C#/VB is to NOT reference the COM dll. The dll to reference in the project is the .NET assembly TDx.TDxInput.dll. I think the most effective procedure is to copy the file to a location local to the project so that if a revision control system is being used it can be checked in and out and there is no need to install 3dxware to build.

To add the reference go to the ‘Browse’ tab in the ‘Add Reference’ dialog, browse to where the local copy of TDx.TDxInput.dll is, select and ok.

To use tdxinput In the c# code add the line using TDx.TDxInput;

The objects are reference as TDx.TDxInput.Object

e.g.

private TDx.TDxInput.Device device;

TDx.TDxInput.dll will need to be distributed by the 3rd party and copied to the installation directory of the 3rd party product (but NOT added to the Global Assembly Cache). Because when we install 3dxware we add TDx.TDxInput.dll to the GAC, the third party product will use our copy of TDx.TDxInput.dll when 3dxware is installed, otherwise the local copy.

Markus
PowderGoblin
Posts: 25
Joined: Thu Dec 18, 2008 11:41 am

Case closed

Post by PowderGoblin »

Just in case - This case has been resolved.
Some of the resolution is also mentioned in another post of mine (also closed):
"Differentiating between Roll and Spin"

Markus - many most sincere thanks.
Post Reply