Hello! I was wondering if it is possible to Invoke/BeginInvoke a delegate from a non-managed thread.
To elaborate, I've got a Windows Forms... form which contains a little image (PictureBox object) that indicates the current state of the PC's Wi-Fi connection (online/offline).
I have registered a callback function using the WlanRegisterNotification function from the Native Wi-Fi API. Whenever the network connection state changes, my callback is executed (on a different thread, if I remember correctly) and I get the new connection state in one of the callback function parameters.
I was wondering if I could immediately BeginInvoke a delegate on my form from the callback function in order to change the image displayed in my PictureBox, but I remember vague warnings from various sources which recommend against mixing managed thread and non-managed thread code. I could not find any source that addresses my example in detail, though, and I'm having trouble deducing why my example could be a bad idea.
Has anyone attempted something like this?