Click here to Skip to main content
15,922,325 members
Home / Discussions / C#
   

C#

 
GeneralRe: GDI+ drawing onto picturebox Pin
xiaowenjie20-Oct-04 7:49
xiaowenjie20-Oct-04 7:49 
GeneralRe: GDI+ drawing onto picturebox Pin
Heath Stewart20-Oct-04 9:51
protectorHeath Stewart20-Oct-04 9:51 
Generalderivation question Pin
3Dizard20-Oct-04 5:33
3Dizard20-Oct-04 5:33 
GeneralRe: derivation question Pin
Heath Stewart20-Oct-04 6:32
protectorHeath Stewart20-Oct-04 6:32 
GeneralRe: derivation question Pin
J4amieC20-Oct-04 22:41
J4amieC20-Oct-04 22:41 
GeneralRe: derivation question Pin
Heath Stewart21-Oct-04 6:27
protectorHeath Stewart21-Oct-04 6:27 
GeneralC# COM Interop Pin
koch.david20-Oct-04 5:03
koch.david20-Oct-04 5:03 
GeneralRe: C# COM Interop Pin
Heath Stewart20-Oct-04 5:50
protectorHeath Stewart20-Oct-04 5:50 
What's the threading model of the COM server?

If you're objective is to send the next command back to the server in the first thread (the thread on which your proxy was instantiated), then you need to invoke a method on that thread. If you're calling methods on your proxy from a Windows Forms control or form, you can use Control.Invoke. The Framework handles calling the method on the thread on which the control was created if you call it right. For example:
delegate void SendCommandHandler(string command);
void SendCommand(string command)
{
  // Send the command to the COM server...
}
void Callback()
{
  // This represents the callback that is invoked by the COM server.
  if (InvokeRequired)
  {
    SendCommandHandler d = new SendCommandHandler(SendCommand);
    Invoke(d, new object[] {"DO SOMETHING"});
  }
  else SendCommand("DO SOMETHING");
}


This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: C# COM Interop Pin
koch.david21-Oct-04 1:27
koch.david21-Oct-04 1:27 
GeneralRe: C# COM Interop Pin
Heath Stewart21-Oct-04 6:18
protectorHeath Stewart21-Oct-04 6:18 
GeneralTAPI Pin
rpussewela20-Oct-04 2:45
rpussewela20-Oct-04 2:45 
GeneralRe: TAPI Pin
Dave Kreskowiak20-Oct-04 2:54
mveDave Kreskowiak20-Oct-04 2:54 
GeneralMDI closing a child form Pin
Jonckheere20-Oct-04 1:50
Jonckheere20-Oct-04 1:50 
GeneralRe: MDI closing a child form Pin
benjymous20-Oct-04 3:05
benjymous20-Oct-04 3:05 
GeneralRe: MDI closing a child form Pin
Jonckheere20-Oct-04 3:24
Jonckheere20-Oct-04 3:24 
GeneralRe: MDI closing a child form Pin
benjymous20-Oct-04 3:42
benjymous20-Oct-04 3:42 
GeneralRe: MDI closing a child form Pin
Jonckheere21-Oct-04 3:47
Jonckheere21-Oct-04 3:47 
GeneralRe: MDI closing a child form Pin
Luis Alonso Ramos21-Oct-04 9:08
Luis Alonso Ramos21-Oct-04 9:08 
Generalbackground application Pin
ppp00120-Oct-04 1:31
ppp00120-Oct-04 1:31 
GeneralRe: background application Pin
manivannan.p20-Oct-04 4:42
manivannan.p20-Oct-04 4:42 
GeneralSending Message to all clients Pin
Zapss20-Oct-04 1:23
Zapss20-Oct-04 1:23 
GeneralRe: Sending Message to all clients Pin
Heath Stewart20-Oct-04 6:27
protectorHeath Stewart20-Oct-04 6:27 
GeneralRe: Sending Message to all clients Pin
Zapss20-Oct-04 20:25
Zapss20-Oct-04 20:25 
Generalenabling log4net Pin
samithas20-Oct-04 0:56
samithas20-Oct-04 0:56 
GeneralRe: enabling log4net Pin
Steve Maier20-Oct-04 4:54
professionalSteve Maier20-Oct-04 4:54 

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.