Archived

This topic is now archived and is closed to further replies.

DI function hints MSVC++

This topic is 5536 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, For somereason I don't get any function hints in MSVC++ 6.0. I have added all the libs and header files into my project, and yet there are still no hints. I get hints with direct3D, but not with direct input. Anyone know why? Not really sure what to call them.. tooltips? EDIT: Also, when I try and run my program, DI crashes it with an "unhandled exception in MainApp.exe: 0xC0000005: Access Violation".. Anyone know why? My program should exit if my device wasn't created properly @_@... Fuzztrek ¬_¬ [edited by - Fuzztrek on October 18, 2002 11:37:13 PM]

Share this post


Link to post
Share on other sites
Actually Intellisense will work with new APIs if you include the necessary source and header files. However, there are some circumstances that it won''t work under. For instance, if your code is heavily object oriented, then Intellisense will brake, badly! Also, if you''re code has many pointers, Intellisense seems to have trouble sifting through pointers.

----
AIDS

Share this post


Link to post
Share on other sites
TheAIDSVirus, could you please explain what you mean by heavily OO? I''m just curious since I have a project with well over 100 classes in it and I routinely use the auto statement completion feature of the IDE. Thanks.

Share this post


Link to post
Share on other sites
Sure. One example I can think of off the tope of my head is late binding (using virtual functions). Sometimes when I obtain a pointer to the derived class object through the base class the Intellisense won''t pop up. It''s not every time and I can''t find any rhyme or reason for it, but I have confused Intellisense this way. (sadly ) Using typedefs and macros always give me trouble with my Intellisense, but that''s probably not very relevant to your question.

All I really know is it seems the more pointers, classes, and source files there are, the more likely Intellisense will break. I, like you, have written programs with many classes and never had it fail once. Then again, I''ve done the same thing in other programs and had it not work once. It''s really bizarre to me. I should probably check my code since broken Intellisense is often a sign of broken code. (memory leaks, bad pointers, etc., but who''s going to admit their code sucks? )

Now that I read the first post again, you might want to correct that Access Violation first, Fuzztrek. If you can''t find it, post the code. That might be what''s breaking the Intellisense.

----
AIDS

Share this post


Link to post
Share on other sites
GetDeviceState (which fills your key buffer with the current true false values of every key) returns an HRESULT value which you can use to see if you really have your device available. If not you need to keep using the Aquire method until you do get it.

You also need to check your DInput device variable to make sure it isn''t NULL before trying to grab the key states using it.

You may also be failing to create the proper data format for your DInput variable. You may be trying to read keyboard input when it''s set up to handle joystick input or something.

You also may be creating the main DInput variable and forgetting to create the sub variable that actually handles a specific device.

There''s a really simple example in the doc you can use to reference.

Ben


IcarusIndie.com [ The Rabbit Hole | The Labyrinth | DevZone | Gang Wars | The Wall | Hosting | Tiberian Merchandise!!!! | GameShot ]

Share this post


Link to post
Share on other sites
Thanks for the info TheAIDSVirus. I have had those types of problems, now that you mention them.

Also, thanks for the link DrunkenHyena. As a hobbyist, any help I can get with these massive APIs would be worth the money.

Share this post


Link to post
Share on other sites