Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Why can't I access any input devices?!


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
23 replies to this topic

#1 myvraccount   Members   -  Reputation: 133

Like
2Likes
Like

Posted 09 June 2014 - 10:11 AM

For quite a while now, I've been trying to do some things that shouldn't be all that complicated, but they're seemingly impossible!  Someone please, please, PLEASE tell me how to do ANY of them!  I just want to get a Novint Falcon, Razer Hydra, Oculus Rift, and Logitech Force 3D Pro to all work in C#.  I'm using Visual Studio 2012 Express on Windows 7 Professional.

 

 

For the first problem, Novint has instructions on how to set up a Falcon in Visual Studio, but only version 6 or 2003, which are ancient, and hardly even available/compatible anymore!  And the 2012 interface is completely different.  Also, their instructions are only for C++.  If it's only possible to do it in C++ I can accept that, and I guess I'll have to make a wrapper for C#, but I just need it working somehow, regardless of the language.  Their customer support is a joke in which I fail to see the humor.  They just told me that it works the same way in 2012 as 2003, and it clearly doesn't, since the interface has almost none of the same options.  When I politely explained this, they told me I should return the Falcon for a refund.  However, I don't see how that would solve my goal and enable me to get it to work programmatically.  Basically, I need to do these things:

-  Set some environment variables (this was actually done automatically during installation)

-  Set the lib and include paths (I think I may have figured that one out but I can't verify whether it's correct)

-  Include the library (for some reason I can't get it into my project and have it work at all)

It's actually a lot more complicated than it sounds.  I was getting a lot of errors and things weren't available that seem like they should be.  I'm on a different computer now so I don't have the details, but in any case, if anyone has ever used this API or made a Falcon work programmatically AT ALL, please tell me how!  If you somehow got it to work in DirectInput I'd be interested to know that as well!

 

 

As for the Razer Hydra, it seems that their API is also for C++ (although I heard something about a wrapper for C#.  Does anyone know about this or its progress?  BTW this is supposedly the same API that will be used by STEM.)  I seemed to be able to sloppily get their DLLs and garbage imported into a simple C++ test project, in which I then just called a function to check if the Hydra is connected, and wouldn't you know it - it doesn't compile!  I got a error that the DLL is invalid or some nonsense.  I tried it with the 32 and 64 bit DLLs and neither work, though they each say a slightly different position in the file which is invalid.  I got these files directly from Sixense (they created them) and I didn't have any error downloading them or installing anything.  The drivers and everything else work, and so should this.  I don't see how there could be a problem with the files, because they're the same ones that any developers would use.  It seems like something else must be going wrong but I can't imagine what.  Has anyone been able to get this to work, and if so, how?

 

 

Honestly, I don't even remember where I ended up with the Oculus Rift (I think it's another C++ one though.  Doesn't anyone use .NET?)  I think I got some third party thing because I couldn't find the files I needed directly from them.  Anyway, nothing works, but I didn't mess with it much because I've been focusing on the other ones more.  Regardless, if anyone has any info about this, as usual, please tell me!

 

 

The code to access the Force 3D Pro joystick works, but not the force feedback (which is the part I really need!)  I know the motor is working correctly, I just can't get the code right.  I'm using DirectInput in SharpDX (almost identical to SlimDX) in C#.  I get an error that the device is unregistered.  I don't see any function for registering the device, anywhere in the whole API.  I only have vague recollections of things I did in DirectInput in C++, and since moving to C#, I haven't had to register anything, and the SharpDX documentation is terrible.  So if anyone knows how to do this, it would be much appreciated!

 

 

By the way, for some reason, people often mistake me for a beginner and accuse me of biting off more than I can chew, and telling me to give up (much like the Novint customer support).  If that's all you intend to do, save your breath, er... typing, because:

A)  I'm never going to give up on this.  It's tremendously important that I get these things working, even if it takes me 20 years!

B)  I'm not a beginner at all.  I've been writing code longer than some of you have been alive.  It's just that they keep changing the interface in Visual Studio, so the way to import any libraries keeps changing, and these companies provide little to no support for development for their products, and nothing ever works correctly for some reason.  It's like the whole world's defective, and it's driving me mad!

 

But I would appreciate any information that could POSSIBLY be useful!  Thanks a lot!



Sponsor:

#2 frob   Moderators   -  Reputation: 22779

Like
4Likes
Like

Posted 09 June 2014 - 11:27 AM

I just want to get a Novint Falcon, Razer Hydra, Oculus Rift, and Logitech Force 3D Pro to all work in C#.

Interesting combination.
 

I think it's another C++ one though. Doesn't anyone use .NET?

No, and for good reason.
 
The entire reason EVERYTHING is based on C bindings (or increasingly C++ bindings, which are closely related) is that they can be used everywhere.  You can access them in C, and C++, you can also access them in Python and C# and Java and Allegro and D and Lisp and assembly and ADA and Pascal and Cobol and any other language you choose.

 

Really, it isn't the C part that is necessary, it is the underlying binary format of the object files. As long as you can call things and put the right things in the correct registers and stack locations, everything just works. The only tricky part is getting your language to put all the data in the right places in the right format.
 

I guess I'll have to make a wrapper for C#, but I just need it working somehow, regardless of the language.

This is your answer.
 
Get a working copy of the libraries.  Then use tools of your language to bind to those libraries. In the case of C#, that generally means p/invoke. It isn't THAT difficult. If it gets too tedious for you, there are many tools out there that can do it for you. Like this one, which is tiny and easy.  Or this one, which is very full featured. Or you can buy one of the expensive libraries for it.


Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#3 myvraccount   Members   -  Reputation: 133

Like
0Likes
Like

Posted 09 June 2014 - 02:08 PM

OK, first of all, I understand that C/C++ are more compatible and compiled to machine language and all that, but if you're writing a program with hundreds of classes and countless dependencies between them (often circular dependencies), do you realize how much of a nightmare that can be in C++?  I always get a million circular include errors that I can never resolve.  I need a FULLY object-oriented language.  Java would work I guess, but it isn't very compatible with many of the things I need.  Eiffel even less so, which basically leaves .NET (you mentioned D.  Does anyone actually even use that?), and honestly, I just want everything to be as simple and clean as possible.  Besides, I've already written a ton of other code in C# that needs to be used in conjunction with this.  The .NET IDE is so much better, and I'm not sure I could even install VS6 on my PC.  But supposedly, anything that works in that C++ should work in C++.NET also, right?

 

 

In any case, like I said, I use C++ in VS2012 when I absolutely HAVE TO, but otherwise, I prefer C#.  So for some of these APIs that were made to be used in C++, that's what I'm doing, but trying to write a wrapper around them for .NET.

 

 

Get a working copy of the libraries.

 

 

As for having a working copy of the libraries, I can't imagine why they wouldn't be working already, since they're directly from the manufacturer's website.  As I said, I suspect that somehow something else is wrong or incompatible, but for some reason it makes it seem as though the files are corrupt.  And this only applies to the Hydra.

 

 

It isn't THAT difficult.

 

 

And yes, it is THAT difficult, as evidenced by the fact that I've been trying to get it to work for months now and have made very little progress.  Ideally, I'd like to have it working by the end of the year if possible.  Once all the DLLs are in the project and connected correctly, the rest of it (the code) will be a breeze.  And I think it's mainly just that these APIs are particularly tough to set up.  I never had this much trouble with DirectX (although it was long enough ago that I don't even remember what I did, but I know it wouldn't entirely fix these problems anyway).

 

 

Thanks for the links.  I looked at the pages, but I won't have time to try them out until the weekend.  I'll let you know how it goes.  However, I have a sneaking suspicion that it may not fix the problem, only because each API has specific instructions of how to get the DLLs imported and working within the project, which involve going into options/settings from menus, which open up windows, and setting a bunch of stuff inside them (mostly typing paths and stuff into text boxes).  I know that all sounds terribly generic, but the point I'm trying to make is that I need to be able to configure various project settings in a specific way, which seems to vary for each API, and at no point do any of the instructions both 1) apply to the interface I am given AND 2) actually accomplish what it's supposed to.

 

 

Also, I've noticed that in different projects, I get different options/settings available to me!  It's completely inconsistent, i.e. sometimes I get a button to browse for DLLs, sometimes not; sometimes I have menu options that allow me to view project settings one way, sometimes they look an entirely different way, sometimes they're not available at all; sometimes if I put DLLs directly into my project folder, I can "add existing item" and it can be imported that way and may work or sometimes not!  It's the worst interface I've ever seen, and I don't know of anywhere that will actually tell me how to use it!

 

 

So what I would really like ideally is just a step-by-step guide of how to set up any or all the APIs, similar to the guides they provide, but with one key difference: it would actually WORK!  Can anyone possibly provide me that please?  It would be absolutely amazing!  Thanks.


Edited by myvraccount, 09 June 2014 - 02:14 PM.


#4 BitMaster   Crossbones+   -  Reputation: 4436

Like
1Likes
Like

Posted 09 June 2014 - 03:06 PM

As for the Razer Hydra, it seems that their API is also for C++ (although I heard something about a wrapper for C#.  Does anyone know about this or its progress?  BTW this is supposedly the same API that will be used by STEM.)  I seemed to be able to sloppily get their DLLs and garbage imported into a simple C++ test project, in which I then just called a function to check if the Hydra is connected, and wouldn't you know it - it doesn't compile!  I got a error that the DLL is invalid or some nonsense.  I tried it with the 32 and 64 bit DLLs and neither work, though they each say a slightly different position in the file which is invalid.  I got these files directly from Sixense (they created them) and I didn't have any error downloading them or installing anything.  The drivers and everything else work, and so should this.  I don't see how there could be a problem with the files, because they're the same ones that any developers would use.  It seems like something else must be going wrong but I can't imagine what.  Has anyone been able to get this to work, and if so, how?

You seem to be doing something wrong. DLLs don't feature during compilation at all (nevertheless you claim there are compile errors). You might be describing linker problems, but DLLs in almost all cases don't feature during linking as well (the import libraries do. You are not giving the linker the DLLs instead of the import libraries, do you?). The point where actual problems with DLLs usually happen is during runtime.
Unfortunately you are not describing what you tried nor the error message (What exactly did you do? What exactly is the error message? Do not try to paraphrase errors, copy'n'paste them).

By the way, for some reason, people often mistake me for a beginner

Yes, unfortunately I can see how that would happen. You do not describe what you did and what your exact errors are in any sufficient detail to allow helping you (I picked one of your paragraphs to write something about but I could have done something very similar with all of them).
As another example your problems with the Falcon sound like you just need more accurate descriptions on where to set the include directory/library search paths in modern MSVCs. That's the usual thing you need to do with libraries. Very occasional you need something more (like disabling exceptions for some reason). If that is truly the problem you are having (and if it is not, once again: What does the description say? What did you try? What happened?) then I would strongly suggest you spend some more time with C++ in simpler scenarios. Write some programs, work on linking with a library of your own creation.
Because right now it seems you are stuck on extremely simple things and you only have two choices:
1) wait for someone to write the C# wrappers you need.
2) get more experience with C and/or C++ and write them yourself.
Since you seem to committed to this, even if it takes 20 years, starting on (2) might not be a bad idea. Worst case, you learned some new stuff by the time (1) happens.

#5 myvraccount   Members   -  Reputation: 133

Like
0Likes
Like

Posted 10 June 2014 - 07:44 AM

What exactly did you do? What exactly is the error message? Do not try to paraphrase errors, copy'n'paste them

 

 

Unfortunately I don't remember at this exact moment.  I can't copy and paste anything, because I'm using a different computer and I'm not even at home.  Besides, the computer on which I do my developing does not have an Internet connection.  In any case, I didn't think I'd need specific details about what I did, because I was hoping someone would just have a step-by-step process for me.  But I'll look into the DLL/Lib problem, but I just did what Razer's instructions said to do.

 

 

I would strongly suggest you spend some more time with C++ in simpler scenarios. Write some programs, work on linking with a library of your own creation.

 

Well I've spent about 15 years with C++ in fairly complicated scenarios.  The code doesn't trip me up at all.  It's just stuff like this that always gets me.  As for making my own library, I wouldn't even know where to start, and I never seemed to find good information on that the few times I seared for it out of curiosity, though I've never needed to do it before, so I didn't really care.  *sigh* I wish programming could just be programming!

 

 

As another example your problems with the Falcon sound like you just need more accurate descriptions on where to set the include directory/library search paths in modern MSVCs.

 

 

Yes!  That's exactly what was going wrong!  The PDF from Novint said to set the directory and library paths, but there were a couple different ways they needed to be done, and then I had to import the DLL or lib (I don't remember which), which it didn't even say how to do, so I think I just put it into the project folder and included it into the project, to no avail.  I had taken some notes and sent an email to Novint support, and I'll paste the conversation here for clarification.  The newest response they sent is one I just now saw, so I haven't had a chance to analyze it or try it out at all.  If anyone wants to dig deeply into this, the PDF I refer to is available from Novint's website (If I remember correctly, it's included with the SDK by clicking the "here" link under "Developer Downloads" in the Support->Downloads section, but I'm not sure if you can download JUST the PDF).  Anyway, you can see why I'm a bit frustrated:

 

 

ME:

 

 

I've been trying to set up the Falcon SDK to use, following the instructions in the PDF manual. I've already installed it, and the environment variables are set correctly (I didn't do that; did it happen automatically during installation?), but the Path variable has other things along with it, which don't appear to be relevant to the Falcon at all. Is that alright?

 

Then I saw in the instructions how to set it up in a Visual Studio 6 or 2003 program. Unfortunately, these instructions are very outdated, because I'm using Visual Studio 2012 Express. How would I set it up to use the necessary DLLs or any other files in that version? I'm just trying to get to the point where I can write code and test it, and then I can take it from there, thanks.
 

 

THEM:

 

 

Good on setting up up the environment variable ... that is set
correctly during the installation of the Novint (HDAL) SDK. The
NOVINT_DEVICE_SUPPORT environment variable tells the operating system
and applications using the Falcon where to find the DLLs, initialization
files, and in your case the Novint Falcon SDK library file locations for
the program you want . Our SDK contains all the documentation and
software development support files needed to develop applications using
the Novint Falcon haptic interface device up to and including the Haptic
Device Abstraction Layer (HDAL) level. Although you are using a more up
to date Visual Studio version, the general steps described in the
HDAL_ProgrammersGuide.pdf are the same.

 

 

ME:

 

 

I'm sorry for being contradictory, but I don't see how the steps can be the same, because I compared the instructions of section 4.1 of the HDAL_ProgrammersGuide.pdf to the options that are available to me in Visual Studio 2012, and found many extreme differences between them:
 

(Please bare with me, as I'm on a different computer now and writing this based on notes that I took while experimenting to try to get it to work, so I don't have any screenshots available.)

First of all, the images in the PDF of the Tools->Options window look completely different that what I saw in VS 2012. The instructions describing what to do, corresponding to that interface, couldn't be applied to the interface that I have to use.

In 4.1.1, it says to click the "show directories for:" dropdown box, and to set values for the "include files" and "library files" and to click a "browse" button at some point, none of which were present in the interface I was using. I can't find any wan to complete this step.

In 4.1.2, it says to choose the Project->Settings menu option. I don't even have that option at all. There is a Project->Properties option though (or Project->X Properties, where X is the name of the project). I looked in that and found similar information that was worded differently and set up completely differently than the screenshots in the PDF, but I think I might have figured this part out, but would like confirmation as to whether I'm actually on the right track, because I could just as easily be wrong. Here's what I did:
In Project->Properties, I chose "All Configurations" from the "Configuration" dropdown list, then in the tree view I selected Configuration Properties->VC++ Directories, and it displayed a lot of properties relevant to that on the right side. In the "Include Directories" box, I appended "$(NOVINT_DEVICE_SUPPORT)\include", and in the "Include Libraries" box I appended "$(NOVINT_DEVICE_SUPPORT)\lib". This seems to be a reasonable thing to do but I have no proof that it's correct, and it still doesn't solve 4.1.1, only 4.1.2, and only assuming it's correct.

4.1.3 says to type "hdl.lib" into the "object/library modules" textbox, but that doesn't appear anywhere, so I don't know where to put this at all. I'm guessing without this, the whole thing falls apart.
 

I don't mean to complain, but quite frankly, I wish there was a newer version of the PDF. Visual Studio 2003 is 11 years old now, and Visual Studio 6 was outdated even when the Falcon was first produced. By now, version 6 is practically ancient.

 

 

THEM:

 

 

We are sorry you are still having issues, but the use of our lower-level
type SDK requires comfort in using the visual studio environment and the
c++ language. We would be happy to offer you a refund if you have
purchased your Falcon in the last 45 days (normal money back guarantee
time is 30 days). Please let us know if wish to return your Falcon so
we can issue you a return authorization number and provide you with the
necessary information.

 

 

ME:

 

 

Excuse me, but I don't see how that's relevant. I am quite comfortable with Visual Studio and C++, and have been using it for about 15 years. The problem is not in my lack of understanding, but rather in the lack of accuracy and compatibility in the instructions. I would just like instructions that are compatible with Visual Studio 2012 please.

 

 

THEM:

 

 

We seem to have reached an impasse. There is nothing special about
using our SDK ... it is a library package. Your project just needs to
know where the SDK related .h and .lib files are. The actual files
required for a project (i.e., hdl.h, hdl.lib, etc.) can be found in
the/C:\Program Files (x86)\Novint\HDAL_SDK_2.1.3\include/ and/C:\Program
Files (x86)\Novint\HDAL_SDK_2.1.3\lib /folders and sub folders of the
SDK package. The NOVINT_DEVICE_SUPPORT environment variable needs to
point to C:\Program Files (x86)\Novint\HDAL_SDK_2.1.3 so that SDK
related DLLs and device bin files can be found by the system when
running SDK developed applications.
 



#6 BitMaster   Crossbones+   -  Reputation: 4436

Like
3Likes
Like

Posted 10 June 2014 - 08:07 AM

From what I can tell from the flow of conversation setting up the basic search paths for your IDE of choice is indeed the problem you seem to be having. It's not their job to teach you that - that is like buying a book from a store and then complaining to them that you are unable to read. When they say

We are sorry you are still having issues, but the use of our lower-level
type SDK requires comfort in using the visual studio environment and the
c++ language.

I can only agree with them. The should not even have to give you any special instructions. When a developer installs a library, they will usually immediately look for the headers, import libraries and DLLs and work with them as they work with any other library.

I see no chance for you to complete your project if you cannot even master to link to a library without exact screenshots and instructions guiding your way. If you have specific problems (not the 'it does not work' we get so far) then we are probably happy to help, although I would say practically all of your problems can be solved quicker by simply googling.

#7 myvraccount   Members   -  Reputation: 133

Like
0Likes
Like

Posted 10 June 2014 - 10:52 AM

It's not their job to teach you that - that is like buying a book from a store and then complaining to them that you are unable to read.

 

 

I understand your point but I think it might be a bit of an overstatement.  It seems API specific to me (see note below).  Besides, if they're going to provide instructions for how to do something, they should at least work.  Also, I don't understand why Microsoft needs to drastically alter the IDE every 5 minutes (it's not even consistent between different projects, which I mentioned before but no one else acknowledges), and do you know anybody who still uses VS 2003, or worse yet, 6.0?!  Falcons aren't even that old, so it's just stupid for it to be that outdated.

 

 

When a developer installs a library, they will usually immediately look for the headers, import libraries and DLLs and work with them as they work with any other library.

 

 

Well it seems to me that whenever there are instructions for how to do this, they're always very specific to the API.  There doesn't seem to be any generic way, or else there are 50 million generic ways - so everyone does it differently - and I can never get any of them to work at all!

 

 

If you have specific problems (not the 'it does not work' we get so far) then we are probably happy to help, although I would say practically all of your problems can be solved quicker by simply googling.

 

 

I was trying to give you specific information (and a lot of the stuff I put in the e-mail conversation I reposted is very specific, but it requires the PDF to understand the context), but like I said, I can't get the info from my computer and I'm not even at home.

 

Also, I tried searching for answers (search criteria: how to link a dll in visual studio 2012), and as usually happens whenever I try to run a search, I get nothing that solves my problem.  One result page is just someone who posted a question about getting DLL files into his 2012 project directly, which is part of my problem (but doesn't address path setting), but people just say to copy a glew32.dll and a bunch of stuff that I don't think is relevant.  Another page is on msdn, and links to a bunch of other related pages, like a tutorial, but I can't find where it says how to actually do it, let alone provide any screenshots.  It does however have a page about creating a new DLL so I'll check that out, but I'm not sure it will fix my problem in the long run but it's worth a shot.  The rest of the results degrade into increasingly irrelevant garbage.

 

 

I swear I couldn't get deeper into DLL Hell! (I know that's not quite the way the phrase is usually used, but I find it more fitting).



#8 BitMaster   Crossbones+   -  Reputation: 4436

Like
4Likes
Like

Posted 10 June 2014 - 11:24 AM

Despite your claims you don't ever provide any specific information. Important bits of information are:

1) what have you done?

2) what happens (including the exact verbatim error messages you are getting)?

Considering we are most likely dealing with the typical problems of someone inexperienced trying to link a library even extremely basic information regarding (2) would most likely be enough to help you (for example "C1083: Cannot open include file: 'blabla.h'").

 

The basic procedure for linking a library is always the same:

a) make sure the compiler can find the include files (failure to do so correctly will for example result in a C1083)

b) specify the path where import libraries can be found (failure to do so correctly will cause problems with ©)

c) link the required import libraries (missing libraries will result for example in LNK2001s; messing up during (b) will result for example in LNK1181)

Really, as far as libraries go you have the simple case to deal with. You don't have to compile any library yourself to ensure the runtime and compile time options match. You just have to get something linked that dropped into your lap. You might have to observe specific documented restrictions in extreme cases (some compile time options that need to be set in a specific way, runtime libraries that have to be used or even exact compiler version numbers), but most libraries like that don't require anything like that.

 

The core issue is, that after four extremely verbose posts of yourself, you still have not provided any information to help narrow down your problems into one of the categories above. As a result, helping you is nearly impossible. Very general, unspecific problems will result in very general, unspecific answers.

 

There is a lot of self-pity and complaining but the signal-to-noise-ratio is frighteningly low.



#9 Buckeye   Crossbones+   -  Reputation: 6367

Like
5Likes
Like

Posted 10 June 2014 - 11:58 AM


I tried searching for answers (search criteria: how to link a dll in visual studio 2012)

 

You shouldn't be trying to link DLLs to your project. You link lib files - files with the extension .lib. DLLs will get loaded at execution time, as needed by the routines you link in the lib files.

 

It appears you may need a refresher on setting up projects to include API header files and library files. Perhaps reviewing a sample solution from the SDK for instances mentioned below will help.

 

The process is generally as follows:

 

Set up the VC++ Directories (in project properties) -

Include Directories: complete paths to the folders where header files (files with the extension .h) can be found for various APIs.

Library Directories: complete paths to the folders where library files (files with the extension .lib) can be found for various APIs.

 

Note: paths that are not part of your default project setup will NOT automatically appear in your project properties. You must determine the appropriate paths for each (non-default) API you want to use.

 

Set up the Linker Input (in project properties) to include the libraries (files with the extension .lib) needed by your application.

 

The header files provide the prototype function calls. You generally specify inclusion of header files in two ways:

#include "some_header.h" // some_header.h is in your project directory
#include <other_header.h> // other_header.h is in one of the Include Directories you list

During compilation, those header files will be loaded by name by searching for them in the Include Directories you've listed in Include Directories.

 

After your app has been compiled, the linking phase is entered. The functions you call in your app will be searched for in the libraries listed in the Linker Input, the search for those libraries being done using the Library paths you list in Library Directories.

 

After successful compilation and linking, during execution of your app, DLLs will be loaded as necessary - DLLs are NOT linked directly by your app.


Edited by Buckeye, 10 June 2014 - 12:06 PM.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.


#10 myvraccount   Members   -  Reputation: 133

Like
0Likes
Like

Posted 10 June 2014 - 01:28 PM

Despite your claims you don't ever provide any specific information.

 

 

I really appreciate all your help.  Honestly I do.  And I don't mean this to sound snide, but by now I don't know any other way to say it and get the point across:

A) For the 15th time, I can't give you much specific information at this moment because I'm not at home and so I don't HAVE it available, except from memory, and trust me, that's very unreliable.

B) There IS a fair amount of information in the e-mail correspondence.  I stated the exact windows I opened and what I clicked and what I typed where.

 

So I don't understand why you keep telling me to provide info.  I'll try to go through the process this weekend and put some better notes together.  I didn't realize I'd need them anyway, because I was expecting that someone might give me a step-by-step explanation.  If it's not that hard, as you say, then it shouldn't be hard to do that, I would think.  Again, I apologize if I sound mean.  I'm really not, and it's not "self-pity" either, but I'm just very, incredibly frustrated.

 

 

You shouldn't be trying to link DLLs to your project. You link lib files - files with the extension .lib. DLLs will get loaded at execution time, as needed by the routines you link in the lib files.

 

 

Honestly, I don't remember.  I may have tried libs.  I probably tried both actually.  I've been at it a long time, but unfortunately I don't typically get any time to mess with it any time but Saturday, so it's kind of an ongoing, occasional struggle.

 

 

The header files provide the prototype function calls. You generally specify inclusion of header files in two ways:

 

 

At one point, either with the Hydra or Falcon API, I just put all the .h and .lib files from the SDK into my project folder and did "add existing files" to all of them.  The headers try to include each other to an extent, and when I tried to compile I got a ton of miscellaneous errors, but some of which were that the headers trying to be included couldn't be found.  I even tried both the "" and the <> notation, and then I also made sure it listed any subdirectories they were in as they appeared in the project.  I never could get the errors to go away, which is weird, since if I create a .h file I never have any trouble using it.

 

 

At least both of you have now given me a relevant list of steps, but unfortunately, they say what to do, but not how to do it (i.e. what menu or button to click, which text box to type what into, etc.) so it's hard to actually follow it.  As I said, with the Falcon, I think I might have figured out part of it, but it still doesn't work as I would expect it to, so obviously something must still be wrong, and there's no way for me to be sure that any of it is actually right at all.  For details see the e-mail correspondence I posted earlier.

 

 

I don't see why it doesn't just let me choose from a menu "Import->Lib/DLL/whatever", then in a popup window, browse and choose what I want, click OK, and then just call functions in my code.  Wouldn't that be great?  I swear it seems like in earlier versions it used to be that easy!



#11 Buckeye   Crossbones+   -  Reputation: 6367

Like
1Likes
Like

Posted 10 June 2014 - 02:02 PM


(i.e. what menu or button to click, which text box to type what into, etc.)

 

What menu can't you find? In which menu was it unclear which text box to type in? The more specific your question, the better others will be able to help you.

 

I googled for several things, such as "visual studio 2012 click project properties," etc. Some of the hits were quite detailed. You might try googling for similar things to answer your questions, as you seem to be dissatisfied with the help you're getting here. Seriously, a gamedev "General Programming" topic is not the place for a step-by-step tutorial on setting up a Visual Studio project. There are a lot of such resources on the web, with more detail and examples than can be provided in a single topic.


Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.


#12 BitMaster   Crossbones+   -  Reputation: 4436

Like
2Likes
Like

Posted 10 June 2014 - 02:35 PM

A) For the 15th time, I can't give you much specific information at this moment because I'm not at home and so I don't HAVE it available, except from memory, and trust me, that's very unreliable.

I'm well aware of that fact. You mentioned it several times. Still, you post pages of text without content instead of doing the reasonable thing: saying "I will post the information asked for after the next time I got home, pasting the actual errors and as much information I can gather into a file on [my USB stick equivalent] and will then paste more detailed information when I then regain Internet access on [some time].
That said, considering what you already are having problems with, doing anything in this area without some kind of Internet access will be an uphill struggle. Extremely uphill. You wouldn't even need much Internet, even a phone with a very limited datarate will do. Mostly just enough to Google a bit and having a way to post in forums like this while you work.
 

B) There IS a fair amount of information in the e-mail correspondence.  I stated the exact windows I opened and what I clicked and what I typed where.

I read it, some bits several times and I see absolutely no hints to give more specific advice.

#13 frob   Moderators   -  Reputation: 22779

Like
3Likes
Like

Posted 10 June 2014 - 03:28 PM


I don't see why it doesn't just let me choose from a menu "Import->Lib/DLL/whatever", then in a popup window, browse and choose what I want, click OK, and then just call functions in my code.  Wouldn't that be great?  I swear it seems like in earlier versions it used to be that easy!

You can.

 

For text-based tools you have DumpBin that lets you view the contents of object files, dlls, executables, and other things you can potentially use. You can also use Dependency Walker for some of those formats.

 

For com-based libraries or .net assemblies you can use the Object Browser built into visual studio, or use many other similar tools.

 

 

For those graphical tools, especially the com-based tools, you can very easily create an instance inside a designer window, see the functions listed out, and run them directly within the IDE using the immediates window.

 

 

So YES, you can do those things, you just need to learn how to use your tools.  


Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#14 myvraccount   Members   -  Reputation: 133

Like
0Likes
Like

Posted 11 June 2014 - 08:55 AM

What menu can't you find? In which menu was it unclear which text box to type in?

 

 

It's not really that I'm looking for specific known windows or text boxes and can't find them.  It's more like there are specific ones in earlier versions, which are absent from the newer versions of VS, because the interface is totally different, and so I don't expect to find them exactly, but I'm just trying to figure out what is their equivalent (i.e. if you do it this way in VS6, you should do it that way in VS 2012 instead, to have the same effect).

 

 

Seriously, a gamedev "General Programming" topic is not the place for a step-by-step tutorial on setting up a Visual Studio project.

 

 

Really?  It seems pretty "General Programming" to me.  Where should I have put it, OpenGL?  Maybe Artificial Intelligence?  Sorry to sound snotty, but come on, I need advice on a fairly general issue so that's where I put it.  I see they moved it to "For Beginners" despite my constant protests that I'm not a beginner.  Fine I give up - I'm a beginner with 22 years of programming experience.  Happy now? :-P

 

 

I'm well aware of that fact. You mentioned it several times. Still, you post pages of text...

 

 

OK, this just seems like a miscommunication.  I was repeating myself because I thought you didn't understand what I was saying, and you were repeating yourself because you thought I didn't understand what you were saying, but we understood each other all along.  Do you understand that?  Because I'm not sure that I do, LOL.

 

 

That said, considering what you already are having problems with, doing anything in this area without some kind of Internet access will be an uphill struggle. Extremely uphill. You wouldn't even need much Internet, even a phone with a very limited datarate will do. Mostly just enough to Google a bit and having a way to post in forums like this while you work.

 

 

Well it's already uphill anyway, but please understand, it's not that I couldn't have Internet access if I wanted it, but for the purpose of security and privacy, my development computer absolutely CANNOT under ANY circumstances be connected to a network.  Not to be too anal about the point I'm making, but if I want to use a search engine, I'll use DuckDuckGo, not Google, for the same reason as stated above.

 

 

frob:  Either you didn't understand what I meant or I'm severely misinterpreting your advice.  I'm not trying to peak into the contents or inner workings of libs and DLLs (although that's not a bad idea!); I'm only trying to get them into my VS 2012 project so that I can call their functions.



#15 Tribad   Members   -  Reputation: 887

Like
0Likes
Like

Posted 11 June 2014 - 09:39 AM

...

  I see they moved it to "For Beginners" despite my constant protests that I'm not a beginner.  Fine I give up - I'm a beginner with 22 years of programming experience.  Happy now? :-P


If you are this long time having experience I still wonder, for as long as I follow this thread, why you unable to give some hint what is not working?
I would expect that you do know all that things that are going around if compiling some software, and it is on all systems the same way. Sometimes they use different names for the same thing, but in the end it is always the same.

I would expect that you can give clear statements about what the compiler or linker output, even if you cannot access the development system.

#16 frob   Moderators   -  Reputation: 22779

Like
0Likes
Like

Posted 11 June 2014 - 09:42 AM


I'm not trying to peak into the contents or inner workings of libs and DLLs (although that's not a bad idea!); I'm only trying to get them into my VS 2012 project so that I can call their functions.

 

That is already covered.  Add a reference to the DLL. Add the necessary marshalling code for the functions you want.  That is all.

 

You countered that advice with:


And yes, it is THAT difficult, as evidenced by the fact that I've been trying to get it to work for months now and have made very little progress.  Ideally, I'd like to have it working by the end of the year if possible.

That is contrary to my experience, and contrary to the evidence I have seen from dozens of others I have personally watched, and contrary to many stories I have read about online. I have seen many projects that can wrap libraries with dozens or hundreds of functions and can do the work in a matter of days with automated tools like SWIG (linked to above). 

 

The fact that YOU made limited progress is more of a reflection on your ability to use the tools (you are a novice at this) rather than the actual complexity of the task. It is something professional programmers are tasked with routinely, and something most are able to accomplish very quickly.

 

Most programmers think of "make a wrapper library" as a simple task because the tools make it extremely easy.  

 

You mention using those tools as an alternative. I think of using those tools as the entire half-hour process.


Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#17 myvraccount   Members   -  Reputation: 133

Like
0Likes
Like

Posted 11 June 2014 - 11:04 AM

If you are this long time having experience I still wonder, for as long as I follow this thread, why you unable to give some hint what is not working?
I would expect that you do know all that things that are going around if compiling some software, and it is on all systems the same way. Sometimes they use different names for the same thing, but in the end it is always the same.

 

Perhaps they're always the same, as long as you're using DLLs, which I rarely ever do, and haven't since the new version of VS, and the interface is not only different, it's inconsistent, hence part of the problem.

 

 

I would expect that you can give clear statements about what the compiler or linker output, even if you cannot access the development system.

 

 

I could tell you exactly what it says... IF I were on that same computer right now, which I'm not.

 

 

That is already covered.  Add a reference to the DLL. Add the necessary marshalling code for the functions you want.  That is all.

 

 

Yes, this is what I'm trying to do, and it's not working for some reason.  But as for marshaling, I'm a little rusty on the terminology, so I looked it up on Wikipedia.  It seems like something you'd do in Corba or something like that, where it needs to use weird reflection of its functions to translate parameter lists into objects describing the parameter lists or some goofy stuff like that, but I'm not sure why I would do it for this.  It seems like an over-complication to me.  Those kinds of things should be done automatically by the compiler anyway.

 

 

It is something professional programmers are tasked with routinely, and something most are able to accomplish very quickly.

 

 

I AM a professional programmer, and throughout the years I've worked at numerous companies, not one of which ever expected me to import a DLL for anything at all (and no, no one at work knows how to do it either).

 

 

You mention using those tools as an alternative. I think of using those tools as the entire half-hour process.

 

 

Well I wasn't aware of these tools until yesterday, but I intend to try out these supposedly excellent tools this weekend when I have time to do it.  Then I'll see whether they live up to their reputation.

 

 

That is contrary to my experience, and contrary to the evidence I have seen from dozens of others I have personally watched, and contrary to many stories I have read about online.

 

 

Well I'm sorry to be so contrary, but I have a specific skill.  I'm extremely good at exactly one thing: programming.  Code code code code code!  And any math or logic necessary to implement it.  I can write any algorithm for compression, cryptography, artificial intelligence, distributed algorithms, compiler/interpreter creation, complicated and realistic physical and graphical calculations, but this nonsense?  No way!  What it comes down to is that they make the interface so bloated with so many different options, and never say what any of them mean or how to use them at all!  Then they change it all every version and I get conflicting information from every possible source or programming guide included with the APIs.  Why don't they even teach any of this stuff in school?  You'd think it would be one of the main topics covered, but nope; not once did we use any DLLs or COM or external files of any kind, nor ever at work for that matter!



#18 Tribad   Members   -  Reputation: 887

Like
0Likes
Like

Posted 11 June 2014 - 11:25 AM


... Perhaps they're always the same, as long as you're using DLLs, which I rarely ever do ....

This is something I realy dont believe,  which may depend on your somehow irritating posts. As stated already. You never link DLLs to your application. For technical reasons it cannot be done. You always link the import library.

 

And the other thing is. On Windows nearly all applications, with only a view exceptions, use DLLs because the application would explode in size if you dont do that.

 

One of the exceptions I think at first are drivers, virus-scanners and such thinks that do not have access to the DLL stuff. And if none in your big company has ever used DLLs it makes me really really wonder.

 

But OK. Let us wait until you have speciifc information about what went wrong.



#19 frob   Moderators   -  Reputation: 22779

Like
4Likes
Like

Posted 11 June 2014 - 12:04 PM

 

That is already covered.  Add a reference to the DLL. Add the necessary marshalling code for the functions you want.  That is all.

 
Yes, this is what I'm trying to do, and it's not working for some reason.  But as for marshaling, I'm a little rusty on the terminology, so I looked it up on Wikipedia.  It seems like something you'd do in Corba or something like that, where it needs to use weird reflection of its functions to translate parameter lists into objects describing the parameter lists or some goofy stuff like that, but I'm not sure why I would do it for this.  It seems like an over-complication to me.  Those kinds of things should be done automatically by the compiler anyway.
 
I AM a professional programmer, and throughout the years I've worked at numerous companies, not one of which ever expected me to import a DLL for anything at all (and no, no one at work knows how to do it either).

 

 
Data marshalling is something you need to do on all languages, including C and C++. It is just a fancy term for ensuring memory is in the right format.
 
If you have been doing windows programming, it has been a central concept since Windows 2.0 when DDE was introduced. Any time you move data between components, such as DDE or COM, you need to properly marshal the data.
 
As this is game development, you have probably already seen how the graphics libraries for DirectX and OpenGL require your data to be properly marshalled to the correct data formats and structures.  That is all that is needed for data marshalling.
 
With your "22 years of programming experience" it is suspicious that you don't know what it is.
 
In C# you need to specify the data structures and make sure you are passing the right format of data, since a C# string is different from a c++ string which is also different from a C-style string and a Pascal style string. 
 
 

Well I'm sorry to be so contrary, but I have a specific skill.  I'm extremely good at exactly one thing: programming.  Code code code code code!  And any math or logic necessary to implement it.  I can write any algorithm for compression, cryptography, artificial intelligence, distributed algorithms, compiler/interpreter creation, complicated and realistic physical and graphical calculations, but this nonsense?  No way!


That is unfortunate for you.

That is very career limiting. No wonder you feel people treat you like a beginner, those are the bare minimum skills all programmers must have. Somebody says "Here is the algorithm written in English, translate it from my implementation to some other language."  Those are code grunts, also called "coding to spec". You can make a living from it but it doesn't offer much as a long-term career.


Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#20 Kaptein   Prime Members   -  Reputation: 2180

Like
0Likes
Like

Posted 11 June 2014 - 12:22 PM

Not sure how you could implement [insert any item on your I-can-write] list without having to add a list of exported symbols to a project, so you can use a dll.

And data marshalling and compression go hand in hand?

 

Anyways, some search results:

http://msdn.microsoft.com/en-us/library/kkt2hd12.aspx

http://stackoverflow.com/questions/19384157/importing-a-lib-file-using-visual-studio

 

I don't see how else to help, since you don't provide any errors or explanation or libraries you want to use. If you at least gave a link to these libraries, someone could read the manual for you.. and translate what it says into simple steps.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS