How to create C# Event to handle MFC Windows message from PostMessage()
问题 I have a managed C++ DLL using WINSOCK. On receive it sends a custom message to a CWnd * via PostMessage(). This works fine when called from unmanaged C++. The target CWnd * is registered with the C++ class after construction using this code: // Registers a window (CWnd *) to receive a message when a valid // incoming data packet is received on this UdpRetrySocket. void CUdpRetrySocket::RegOnReceive(CWnd *i_pOnReceiveWnd, UINT i_RecvMsgId = WM_USER_RECV_DATA_AVAIL) { m_pOnReceiveWnd = i