/////////////cfrmmain.h///////
enum { NM_STORESCP_CALLBACK = WM_USER + 100 };
void __stdcall MyStoreScpCallback(T_StoreProgress* progress, LPCSTR filename);
class TfrmMain : public TForm
{
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(NM_STORESCP_CALLBACK, TMessage, OnStoreSCPCallback);
END_MESSAGE_MAP(TForm);
}
//////////////cfrmmain.cpp////////
void __stdcall MyStoreScpCallback(T_StoreProgress* progress, LPCSTR filename)
{
///emit the message user defined :in QT ,how to postEvent and get the receive ????
SendMessage(Application->MainForm->Handle, NM_STORESCP_CALLBACK,
(WPARAM)progress, (LPARAM)filename);
}
void __fastcall TfrmMain::OnStoreSCPCallback(TMessage &Message)
{
///response to the message ,do something accoring to WPARAM LPARAM
}
void __fastcall TfrmMain::FormShow(TObject *Sender)
{
//now callback here
storescp_execute(m_iServerPort, MyStoreScpCallback);
}
/////////////cfrmmain.h///////
enum { NM_STORESCP_CALLBACK = WM_USER + 100 };
void __stdcall MyStoreScpCallback(T_StoreProgress* progress, LPCSTR filename);
class TfrmMain : public TForm
{
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(NM_STORESCP_CALLBACK, TMessage, OnStoreSCPCallback);
END_MESSAGE_MAP(TForm);
}
//////////////cfrmmain.cpp////////
void __stdcall MyStoreScpCallback(T_StoreProgress* progress, LPCSTR filename)
{
///emit the message user defined :in QT ,how to postEvent and get the receive ????
SendMessage(Application->MainForm->Handle, NM_STORESCP_CALLBACK,
(WPARAM)progress, (LPARAM)filename);
}
void __fastcall TfrmMain::OnStoreSCPCallback(TMessage &Message)
{
///response to the message ,do something accoring to WPARAM LPARAM
}
void __fastcall TfrmMain::FormShow(TObject *Sender)
{
//now callback here
storescp_execute(m_iServerPort, MyStoreScpCallback);
}
To copy to clipboard, switch view to plain text mode
Bookmarks