Archived

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

cruiz

Help! DXINPUT8 Mouse! Help plz!

Recommended Posts

Hi out there! I have already tried to ask someone, my DINPUT8 Mouse problems. I have see that noones respond and that they are other peoples who have the same or similiary problems. I have a friend who has did a simple DIM8 Programm and his pro works!! He gaves me his source and it doesnt work!!!! My source and he''s source are both correct! Trust me!!! Now the libs... I have included all necessary libs. Because the INPUT with Keyboard works well!!!! But it gives me in my pro no errors linking but windows brokes down at the beginning. It isn''t a endlessloop. It is something else. And the source of my friend gives me linking some LINK-ERRORS. Yes I know people, you will now say: Link-errors are bad errors from programmer. Stupid programemr errors and I don''t know what more. But really people i''m onn the end because I don''t know what i could be! Really not!!!! Please write. If you have the same problem too!! We probably could write about our problems. Probably someone knows a good expert in DINPUT things. But please please help me. In hope that someone writes and probably could help me: C.Ruiz (really frustrated) P.S.: Hope you will understand my english. If not I can send you a translation in German and spanish. If you really want to help me...

Share this post


Link to post
Share on other sites
Put this at the top of your code:

  
#define INITGUID
#include <objbase.h>



-Forcas


"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."



Share this post


Link to post
Share on other sites


I think we should began with the #includes because i hace
changed here his source because hes source wasn''t complete
in the includes. Here is my "puzzle" of Includes:


#define INITGUID
#include
#define STRICT
//#include
#include
#include

#include
#include
#include
#include
#include



The Link_Errors are:
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/Cpp1.exe : fatal error LNK1120: 1 unresolved externals


If you hear this: _main you could think that it''s a console.
But..... It''s a full window. Believe me!




Share this post


Link to post
Share on other sites
Sorry what happened with the includes??
I let now the () away.
(How can I do this without taking the () away?)



#define INITGUID
#include objbase.h
#define STRICT
//#include tchar.h
#include windows.h
#include windowsx.h


#include ddraw.h


#include basetsd.h

#include dinput.h

#include stdio.h
#include time.h

Share this post


Link to post
Share on other sites
Well I''m almost sure you are creating a console application. Check the linker settings and check for the option "/subsystem". If it is followed by "console", you have the wrong project type.

Share this post


Link to post
Share on other sites
Thanks!
I was so fixed in the libs and includes that i didn''t
see this little command!!!!!
/subsystem!!!!! Ok Thanks but this is the little problem.
It''s the source of my friend that he gave me.
But now that it works I know that the problem in my programm isn''t from the compiler and not from my pc!

Ok...
The problem of my pro is that it brokes down if I start it.
If it start to do:
hr = lpMouse->GetDeviceState(sizeof(DIMOUSESTATE), &dims);

I copied now the sourceof my friend initilisating the
Objects in the winmain and so on.

A question is: Where should I say "ok get now the mouse state"?
I tried it first to put it in my normal loop:
For example so:
GetTheKeyboardInput();
DrawBitmaps();
UpdateSomething();
.....
GetMouseState();
Is this false to put the GetMouseState here?
I tried it in other way, too:
/////////////////////
dwResult = MsgWaitForMultipleObjects( 1, &g_hMouseEvent,
FALSE, INFINITE, QS_ALLINPUT );

switch( dwResult )
{

case WAIT_OBJECT_0 + 0:

GetMouseState();//Hêre?

break;


case WAIT_OBJECT_0 + 1:
while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
if( msg.message == WM_QUIT )
{
bDone=TRUE;
return false;
}
else
{
TranslateMessage( &msg );
DispatchMessage( &msg );
}
}
break;


}
//////////////
I have put his in my Winmain loop.
I tried it to write what dwresult respond.
To things: A bizarre number or
a one.
I believe that he gives me the one if I move the mouse.
(probably click too)
But it don''t open GetMouseState()!
And if I put the GetMouseState()
on the "case WAIT_OBJECT_0 + 1" it
brokes down again!

Ok, I believe that''s all.
Some little details:
How I already said : DIKeyboard works fine.
There is DDraw to paint my bits.
I tried the mouse in EXCLUSIVE-MODE and NONEXCLUSIVE-MODE.
And there i have dmusic too!

Thanks for everything: C.Ruiz




Share this post


Link to post
Share on other sites