Jump to content
  • Advertisement


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

How come the compiler won't let me cast my DIMOUSESTAT to a void

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

Please help DIMOUSESTATE MouseState; pMouse->GetDeviceState(sizeof(DIMOUSESTATE),(LPVOID) MouseState); what is wrong with this, everybook I have shows it this way here is the error: C:\visualStudioProjects\templates\cDInput.cpp(53) : error C2440: ''type cast'' : cannot convert from ''struct _DIMOUSESTATE'' to ''void *'' No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Thanks in advance for your help -Dapeos

Share this post

Link to post
Share on other sites
try this:

pouse->GetDeviceState(sizeof(DIMOUSESTATE),(LPVOID) &MouseState);

you can't convert a non-pointer to a pointer. so put the little & thingy in front of your MouseState var like above and all should be fine. that gets the memory address of the MouseState var and casts that properly to a void*.


[edited by - Palidine on March 28, 2004 3:27:20 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!