delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/30/14:00:37

From: Ludvig Larsson <ludvig AT club-internet DOT fr>
Newsgroups: comp.os.msdos.djgpp
Subject: Hook up mouse int to function again
Date: Tue, 30 Dec 1997 19:25:02 +0100
Organization: FAAS/GoldHart
Lines: 40
Message-ID: <34A93C7E.67C2@club-internet.fr>
Reply-To: ludvig AT club-internet DOT fr
NNTP-Posting-Host: ppp-122-149.toulouse.club-internet.fr
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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;
}

I'm calling it with:

install_mouse_handler (62,mouse_handle);

and the mouse_handle function:
void mouse_handle(__dpmi_regs *preg)
{

}
Is empty. Everything workt fine(compilation running etc) until I move
the mouse(the mouse_handle function gets a call), the program exits.

Why isn't it working? Do I have to do something special in the
mouse_handle function?

Ludvig Larsson

ps. please send a copy to me.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019