Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

"Error 42: Symbol Undefined _mouse_event@16 --- errorlevel 1"

Moderators: kris

Posted: 10/06/09 06:20:25 Modified: 10/06/09 08:10:41

Hello, I'm using Windows with D 1.041 and Tango 0.99.8 (http://www.dsource.org/projects/tango/wiki/DmdDownloads) and have the following code:

import tango.sys.win32.UserGdi;

class Mouse{
    alias SetCursorPos set_pos;
    alias GetCursorPos get_pos;
    void left_click(){
        mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0);
        mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0);
    }
    void right_click(){
        mouse_event(MOUSEEVENTF_RIGHTDOWN, 0, 0, 0);
        mouse_event(MOUSEEVENTF_RIGHTUP, 0, 0, 0);
    }
}

I'm using mouse_event instead of SendInput? because only that is defined within the UserGdi? module.

When I try to compile it though I get the following error:

Error 42: Symbol Undefined _mouse_event@16 --- errorlevel 1

Any help on that? I already tried it on two Windows (XP) machines.

Author Message

Posted: 10/06/09 11:02:04 -- Modified: 10/06/09 11:02:23 by
kris

probably because the prototype is not declared properly in UserGdi.di ... msdn says it should have 5 arguments, as shown below:

void mouse_event(DWORD, DWORD, DWORD, DWORD, POINTER);

Posted: 10/07/09 06:15:30

Thanks kris! That was it! Also I was wondering if I could try to talk to you somewhere else, via E-Mail or IM for example. If you'd like to just send me an E-Mail to cryzed(at)googlemail(dot)com please, thanks.