mfc-networking

How to create C# Event to handle MFC Windows message from PostMessage()

不打扰是莪最后的温柔 提交于 2019-12-10 19:22:49
问题 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

Using MFC in Windows service?

懵懂的女人 提交于 2019-12-04 13:53:23
问题 I'm starting to develop a Windows service. I want to use some classes from my own, that has little dependencies to some MFC classes like CString, CSocket, CArchive, CMemFile and CObject. MSDN says you need to be very careful about which pieces of MFC you use in the Windows service, but don't specifies it and don't describes the problems that can occur. My questions are: what pieces of MFC can be used? what problems can I expect, by using MFC? which parts of Windows service are critical for

Using MFC in Windows service?

 ̄綄美尐妖づ 提交于 2019-12-03 09:06:21
I'm starting to develop a Windows service. I want to use some classes from my own, that has little dependencies to some MFC classes like CString, CSocket, CArchive, CMemFile and CObject. MSDN says you need to be very careful about which pieces of MFC you use in the Windows service, but don't specifies it and don't describes the problems that can occur. My questions are: what pieces of MFC can be used? what problems can I expect, by using MFC? which parts of Windows service are critical for MFC use? is it advisable to use ATL instead of MFC for Windows service? I'm not sure what they mean in