Sign in to follow this  
BrandonisMaster

Some DirectInput Help Please!

Recommended Posts

Can some one please help me, I've just started directinput and here's my debug problem:
Unhandled exception at 0x00412e5a in paddlegame.exe: 0xC0000005: Access violation reading location 0x00000000.
I honestly have no idea what that means :/ and it says this:
'paddlegame.exe': Loaded 'C:\WINDOWS\system32\serwvdrv.dll'
'paddlegame.exe': Unloaded 'C:\WINDOWS\system32\serwvdrv.dll'
'paddlegame.exe': Loaded 'C:\WINDOWS\system32\serwvdrv.dll'
'paddlegame.exe': Unloaded 'C:\WINDOWS\system32\serwvdrv.dll'
'paddlegame.exe': Loaded 'C:\WINDOWS\system32\AntexWAV.dll', Binary was not built with debug information.
'paddlegame.exe': Unloaded 'C:\WINDOWS\system32\AntexWAV.dll'
'paddlegame.exe': Loaded 'C:\WINDOWS\system32\AntexWAV.dll', Binary was not built with debug information.
'paddlegame.exe': Unloaded 'C:\WINDOWS\system32\AntexWAV.dll'
'paddlegame.exe': Loaded 'C:\WINDOWS\system32\AntexWAV.dll', Binary was not built with debug information.
'paddlegame.exe': Unloaded 'C:\WINDOWS\system32\AntexWAV.dll'
'paddlegame.exe': Loaded 'C:\WINDOWS\system32\AntexWAV.dll', Binary was not built with debug information.
'paddlegame.exe': Unloaded 'C:\WINDOWS\system32\AntexWAV.dll'
'paddlegame.exe': Loaded 'C:\WINDOWS\system32\AntexWAV.dll', Binary was not built with debug information.
'paddlegame.exe': Unloaded 'C:\WINDOWS\system32\AntexWAV.dll'
'paddlegame.exe': Loaded 'C:\WINDOWS\system32\uxtheme.dll'
Please help me :)

Share this post


Link to post
Share on other sites
Quote:
Original post by BrandonisMaster

Unhandled exception at 0x00412e5a in paddlegame.exe: 0xC0000005: Access violation reading location 0x00000000.



dereferencing a NULL pointer... that's as much as I can say with the given information...

Share this post


Link to post
Share on other sites
Quote:
Original post by BrandonisMaster
Heres the line in debug where it messes up:

HRESULT result = dimouse->SetDataFormat(&c_dfDIMouse);
As larvyde said, your mouse pointer is null. You should be checking the return values of ALL DirectX functions that return an interface (Using the SUCCEEDED or FAILED macros).

However, you really shouldn't be using DirectInput for keyboard or mouse input in any case.

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Quote:
Original post by BrandonisMaster
Heres the line in debug where it messes up:

HRESULT result = dimouse->SetDataFormat(&c_dfDIMouse);
As larvyde said, your mouse pointer is null. You should be checking the return values of ALL DirectX functions that return an interface (Using the SUCCEEDED or FAILED macros).

However, you really shouldn't be using DirectInput for keyboard or mouse input in any case.


So what should I be using?

Share this post


Link to post
Share on other sites
Quote:
Original post by BrandonisMaster
Quote:
Original post by Evil Steve
Quote:
Original post by BrandonisMaster
Heres the line in debug where it messes up:

HRESULT result = dimouse->SetDataFormat(&c_dfDIMouse);
As larvyde said, your mouse pointer is null. You should be checking the return values of ALL DirectX functions that return an interface (Using the SUCCEEDED or FAILED macros).

However, you really shouldn't be using DirectInput for keyboard or mouse input in any case.


So what should I be using?
Window messages for most things, or if you really need high DPI input, then raw input.

Share this post


Link to post
Share on other sites
from: http://msdn.microsoft.com/en-us/library/bb206183(VS.85).aspx

Overall, using DirectInput offers no advantages when reading data from mouse or keyboard devices, and the use of DirectInput in these scenarios is discouraged.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this