Click here to Skip to main content
15,887,336 members
Home / Discussions / C#
   

C#

 
GeneralRe: NONCLIENTMETRICS marshalling Pin
Richard Deeming26-Nov-02 6:21
mveRichard Deeming26-Nov-02 6:21 
GeneralRe: NONCLIENTMETRICS marshalling Pin
Matze26-Nov-02 19:27
Matze26-Nov-02 19:27 
GeneralRe: NONCLIENTMETRICS marshalling Pin
Richard Deeming26-Nov-02 22:38
mveRichard Deeming26-Nov-02 22:38 
GeneralRe: NONCLIENTMETRICS marshalling Pin
Matze14-Dec-02 0:50
Matze14-Dec-02 0:50 
GeneralNeed help for my IRC Client Pin
Shock The Dark Mage25-Nov-02 16:21
Shock The Dark Mage25-Nov-02 16:21 
GeneralRe: Need help for my IRC Client Pin
leppie25-Nov-02 22:52
leppie25-Nov-02 22:52 
GeneralRe: Need help for my IRC Client Pin
Shaun Wilde26-Nov-02 4:12
Shaun Wilde26-Nov-02 4:12 
GeneralRe: Need help for my IRC Client Pin
Michael Mac26-Nov-02 10:28
Michael Mac26-Nov-02 10:28 
Shock The Dark Mage wrote:
The VS.NET Debugger raise an exception saying that I can't modify an control(Crownwood.Magic.Controls.TabControl) created in another thread.

I had this problem in my app but I figured out how to fix it.
If you want to modify a control or add a control to a form in other thread the exception will be thrown.
My solution is to use the SendMessage function to move the execution process from one thread to the other. Use DllImport to be able to call it in your code.

SendMessage( hHandle, WM_USER + 1, 0, 0 );

hHandle is the window's handle you want to send a message to
WM_USER + 1 is the message that the main form will receive.

In the main thread you must have a form ( whose handle you passed to SendMessage ). Override the WndProc method
public virtual void WndProc( Message* m )
{
     if ( m->Msg == WM_USER + 1 )
     {
           // Here you can modify ar add control without any problems.
     }
}




43 68 65 65 72 73 2c
4d 69 63 68 61 65 6c
GeneralRe: Need help for my IRC Client Pin
leppie26-Nov-02 11:00
leppie26-Nov-02 11:00 
GeneralRe: Need help for my IRC Client Pin
Shock The Dark Mage26-Nov-02 13:12
Shock The Dark Mage26-Nov-02 13:12 
GeneralRe: Need help for my IRC Client Pin
leppie26-Nov-02 13:28
leppie26-Nov-02 13:28 
GeneralRe: Need help for my IRC Client Pin
Shock The Dark Mage27-Nov-02 15:38
Shock The Dark Mage27-Nov-02 15:38 
GeneralRe: Need help for my IRC Client Pin
leppie28-Nov-02 0:09
leppie28-Nov-02 0:09 
GeneralRe: Need help for my IRC Client Pin
Michael Mac27-Nov-02 3:29
Michael Mac27-Nov-02 3:29 
GeneralRe: Need help for my IRC Client Pin
leppie27-Nov-02 6:58
leppie27-Nov-02 6:58 
Generalmouse hover over MenuItem..it's not working... Pin
lnong25-Nov-02 14:31
lnong25-Nov-02 14:31 
GeneralResX Error Pin
Jassim Rahma25-Nov-02 11:26
Jassim Rahma25-Nov-02 11:26 
GeneralRe: ResX Error Pin
Matze26-Nov-02 0:24
Matze26-Nov-02 0:24 
GeneralCustomized Form Designer Pin
Jassim Rahma24-Nov-02 23:13
Jassim Rahma24-Nov-02 23:13 
GeneralWindows About Box Pin
Jassim Rahma24-Nov-02 23:11
Jassim Rahma24-Nov-02 23:11 
GeneralCheck mdb Password Pin
Jassim Rahma24-Nov-02 23:10
Jassim Rahma24-Nov-02 23:10 
GeneralAudio/Video Library Pin
Jassim Rahma24-Nov-02 23:04
Jassim Rahma24-Nov-02 23:04 
GeneralRe: Audio/Video Library Pin
leppie25-Nov-02 7:21
leppie25-Nov-02 7:21 
GeneralRe: Audio/Video Library Pin
Jassim Rahma25-Nov-02 7:27
Jassim Rahma25-Nov-02 7:27 
GeneralRe: Audio/Video Library Pin
Christian Graus25-Nov-02 12:07
protectorChristian Graus25-Nov-02 12:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.