谢谢tseug. 你的确切中了要害。现在编译已通过,只是又出现新的问题,我不知是不是因为上述的改动而引起。
function getRegisterAction(pStatus
FTSTATUS):integer;cdecl;
begin
case pStatus^.code of
FT_READY_TO_FILL_BUF:
PostMessage(g_hwnd, WM_URU_NOTIFY, MESSAGE_READY_TO_FILL_BUF,0);
FT_BUF_FILLED:
PostMessage(g_hwnd, WM_URU_NOTIFY,MESSAGE_IMAGE_RECEIVED, 0);
。。。。。
end;//g_hwnd我声明成HWND或者application.handle,消息函数还是收不到消息
此回调函数包含了消息传递过程postmessage,执行时也没出现异常,但是消息处理(接收)函数就是收不到消息。
const
WM_URU_NOTIFY=WM_USER+302;
MESSAGE_READY_TO_FILL_BUF=10;
MESSAGE_IMAGE_RECEIVED=11;
...
//消息处理函数
procedure TFPSensorXPD.WMURU(var Message: TMessage);
begin
case message.WParam of
MESSAGE_READY_TO_FILL_BUF:
showmessage('message ready to fill buf');
MESSAGE_IMAGE_RECEIVED:
showmessage('message image receivek');
....
end;
本来是很简单的代码,到了组件中就问题多多了,还望指点