Archived

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

NT troubles...

This topic is 5870 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

Hi! I''m a silly newbie who is having some trouble getting a simple DX3 application running on Windows NT. I know, I know, I shouldnt even bother with DX3 or NT, but I''m kinda stuck. I dont need to do anything exciting anyways. But anywho, I cant create any interfaces in NT. This same program works fime on a DX8a based Win98 machine, but that shouldnt matter, I''d think... I''ve included the following #defines: #define DIRECTDRAW_VERSION 0x0300 #define DIRECTSOUND_VERSION 0x0300 #define DIRECTINPUT_VERSION 0x0300 ..and I''ve taken care to not use anything not incuded with DX3. In fact, the only thing my program does is create DD, DS, and DI interfaces, and then quit. My interface creation statements are: DirectInputCreate(NULL, 0x0300, &lpdi, NULL) DirectSoundCreate(NULL, &lpds, NULL) DirectDrawCreate(NULL, &lpdd, NULL) ..along with more things for error checking and HRESULT dumping. Right now, the creation statements returns with 0x80070057. So, anyone have any ideas? Again, I''m a DX newbie, so I''m probably doing something silly. I cant think of any more information to give, let me know if you want more specifics. Thanks!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
That error handle refers to: "The parameter is incorrect" which, all things being Microsoft is a robust error message.

First:
-----------------
I am pretty sure you cannot use NULL for the first parameter ( which is an HINSTANCE if I remember correctly) so try that out first.

Second:
-----------------
On the DirectInputCreate call do it like such:

hr = DirectInputCreate( hInstance, DIRECTINPUT_VERSION, &lpdi, NULL);

Make sure that your #define is BEFORE the #include for , etc.. This will ensure that all the data structures are correctly DX3 and leave only one place in the code for a change to bite you. ( you are essentially doing this but the problem bit me once by using the same design.. ).

The other thing to check is how the debug version of the DX libs ( COM object ) work on NT - if they do and you can set to MONDO verbose mode you can pretty much debug anything inside of Visual C by looking at the OutputDebugString msgs.

Good luck

Share this post


Link to post
Share on other sites
Blaarg! The only problem ended up being DirectInput being unhappy with a NULL for the HINSTANCE, like you suggested. I changed it, and magically it works fine. Its a bit strange that 98 doesnt care about the calling application''s HINSTANCE, while NT does. DirectDraw ended up being fine. DirectSound was dead too, but that was a different error - no driver. Whoops!

Thanks for your help.

Share this post


Link to post
Share on other sites