Thread: MapPoin VB.Net
View Single Post

  #6 (permalink)  
Old 02-09-2006
Wilfried Wilfried is offline
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Hi Matteo,

Declaring as shared is in my opinion not a solution. You indeed probably solved the problem with synchronizing your threads. But I also think it is only temporary solved.

If you create a component in a particular thread context, normally you have to call all his events also from within same thread context. Synchronizing does not help, the context is what matters.

Note that synchronizing threads is actually disable multithreading

If you really need thread, then I advice if you wants to call mappoint methods then do it in main thread context. The most easy way to do it is to PostMessage to the main thread. Then the custom message handler do the call.

in dotNet you can easy P/Invoke this win32API call. I think in version 2 they have done it theirselve but I still use my own.
Reply With Quote