rem: LeaveEvent *e = (LeaveEvent *)msg->lParam;
add: void *sr = (void *)msg->lParam; LeaveEvent *e; e = (LeaveEvent *)GET_SAFEREF(sr); FREE_SAFEREF(sr);
context: void MrEdDispatchEvent(MSG *msg){  switch (msg->message) {  case WM_RBUTTONDOWN:  case WM_RBUTTONUP:  case WM_RBUTTONDBLCLK:  case WM_MBUTTONDOWN:  case WM_MBUTTONUP:  case WM_MBUTTONDBLCLK:  case WM_LBUTTONDOWN:  case WM_LBUTTONUP:  case WM_LBUTTONDBLCLK:  case WM_MOUSEMOVE:  case WM_MOUSEWHEEL:  case WM_NCLBUTTONDOWN:  case WM_NCRBUTTONDOWN:  case WM_NCMBUTTONDOWN:  case WM_NCLBUTTONDBLCLK:  case WM_NCRBUTTONDBLCLK:  case WM_NCMBUTTONDBLCLK:  case WM_NCMOUSEMOVE:  case WM_NCLBUTTONUP:  case WM_NCRBUTTONUP:  case WM_NCMBUTTONUP:    wxUnhideCursor();    break;  default:    break;  }  if (WM_MRED_LEAVE && (msg->message == WM_MRED_LEAVE)) {    /* Queued leave event */    LeaveEvent *e = (LeaveEvent *)msg->lParam;    wxDoLeaveEvent(e->wnd, e->x, e->y, e->flags);  } else if (!wxTheApp->ProcessMessage(msg)) {#if wxLOG_EVENTS    if (!log)      log = fopen("evtlog", "w");    fprintf(log, "{SEND %lx (%lx) %lx\n",	    msg->hwnd, GetContext(msg->hwnd),	    msg->message);    fflush(log);#endif    TranslateMessage(msg);    can_trampoline_win = msg->hwnd;    last_msg_time = msg->time;          DispatchMessage(msg);#if wxLOG_EVENTS    if (!log)      log = fopen("evtlog", "w");    fprintf(log, " SENT %lx (%lx) %lx %lx %lx}\n",	    msg->hwnd, GetContext(msg->hwnd), msg->message,	    need_trampoline_win, need_trampoline_message);    fflush(log);#endif    can_trampoline_win = 0;    /* See wxEventTrampoline, below: */    {      int iterations;      for (iterations = 0; iterations < 10; iterations++) {	if (msg->hwnd && (need_trampoline_win == msg->hwnd)) {	  HWND win = need_trampoline_win;	  need_trampoline_win = 0;	  wx_trampolining = 1;	  if (iterations < 9)	    can_trampoline_win = win;	  else	    can_trampoline_win = NULL;	  need_trampoline_proc(win, need_trampoline_message,			       need_trampoline_wparam, need_trampoline_lparam);	} else	  break;      }    }  }}