i need to execute code on the primary form
(the one the project start with, CalphaDlg in my case) from another
I try with
including "alphsDlg.h" of course,
but i get the error
error C2352: "CalphaDlg::OnBnClickedButton2": not valid call to non static member function
In think in case of handlers defined with ON_COMMAND_EX macro, the MFC message dispatcher is able to process your commands in chain manner.
For instance, if you have two handlers for some command -- one in a view class and another in main application frame -- and use ON_COMMAND macro, then after processing the message by the view, no other handler will be called.
But if you use ON_COMMAND_EX macro, and the view’s handler returns FALSE, then MFC will continue routing and will call the main frame’s handler too.
In your sample, the OnCommandEx1 handler will be never called because of previous OnCommand1, even if both of them were declared with ON_COMMAND_EX. This macro has effect only in case of different command target objects.
Normally, the send() function will block until threre's enough room in the buffer (16 bytes in this case). If the socket is in nonblocking mode, then send() might send 2 bytes or it could return SOCKET_ERROR with errno set to WSAEWOULDBLOCK.
If you are using non-blocking sockets, you must handle WSAEWOULDBLOCK situations and partial sends.
I have a problem with app icons. I developed an app that can be compiled for different users. Each of this users has it's own app icon and a splash screen. The splash screen is not a problem but the icon is. For now I'm doing the copy/paste of user icons over the old ones before compiling the app. Is there a way to automate this (set an ifdef in the rc file, set some precompile options in VS...)?
I suppose that this works when I must load the icon on app runtime or not ... (if not where I must put this code)? I have to compile the app with the selected icon - the selected icon must be visible in windows explorer (explorer, desktop...)