Mail Archives: djgpp/1997/12/30/18:29:51
At 07:25 12/30/1997 +0100, Ludvig Larsson wrote:
>Hi!
>
>I have hooked up a function that should be called
>when the mouse moves or I push a mousebutton(int10,ax=0x0009), and that
>works, but when the function is called the program exits
>and I get a window(win95) that says that a 'problem'(operation non
>conformé in french) occured at 0002:FFFF.
>I have actually only ripped the example out of the FAQ 18.8:
>
>int install_mouse_handler (unsigned mask,void (*func)(__dpmi_regs *))
>{
> __dpmi_regs r;
> callback_info.pm_offset = (long)func;
> if
>(_go32_dpmi_allocate_real_mode_callback_retf(&callback_info,&callback_regs))
> return -1; /* failure */
> r.x.ax = 0xc;
> r.x.cx = mask;
> __dpmi_int (0x33, &r);
> return (r.x.flags & 1) ? -1 : 0;
>}
It is necessary to tell the INT 33h call the address of your callback. Add
these lines before __dpmi_int:
r.x.es = callback_info.rm_segment;
r.x.dx = callback_info.rm_offset;
>void mouse_handle(__dpmi_regs *preg)
>
This argument, and `callback_regs', should be of type
`_go32_dpmi_registers', not `__dpmi_regs'. I think they might be the same
right now, but just to be pedantic...
Nate Eldredge
eldredge AT ap DOT net
- Raw text -