Click here to Skip to main content
15,915,863 members
Home / Discussions / C#
   

C#

 
GeneralRe: Do you know of a MS COM object that raises events? Pin
Phillip M. Hoff4-Jan-07 20:22
Phillip M. Hoff4-Jan-07 20:22 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 20:31
JoeRip4-Jan-07 20:31 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 20:45
JoeRip4-Jan-07 20:45 
GeneralRe: Do you know of a MS COM object that raises events? Pin
Phillip M. Hoff4-Jan-07 21:05
Phillip M. Hoff4-Jan-07 21:05 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 21:12
JoeRip4-Jan-07 21:12 
GeneralRe: Do you know of a MS COM object that raises events? Pin
Phillip M. Hoff4-Jan-07 21:25
Phillip M. Hoff4-Jan-07 21:25 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 21:34
JoeRip4-Jan-07 21:34 
GeneralRe: Do you know of a MS COM object that raises events? Pin
Phillip M. Hoff4-Jan-07 21:45
Phillip M. Hoff4-Jan-07 21:45 
You would do something like this:

<br />
void itunes_OnDatabaseChangedEvent(object deletedObjectIDs, object changedObjectIDs)<br />
{<br />
  if (InvokeRequired)<br />
  {<br />
    Invoke(new _OnDatabaseChangedEventHandler(itunes_OnDatabaseChangedEvent), new object[] { deletedObjectIDs, changedObjectIDs });<br />
  }<br />
  else<br />
  {<br />
  // Use deletedObjectIDs and changedObjectIDs here as normal.<br />
  }<br />
}<br />


You create an object array with the arguments in the same order in which the method to be executed on the UI thread expects them. The Invoke() method takes care of pulling the array apart and passing them to the method. (The method called never sees the array; it's just a generic way to pass the arguments to Invoke().)

-Phil
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 21:47
JoeRip4-Jan-07 21:47 
GeneralRe: Do you know of a MS COM object that raises events? Pin
Luc Pattyn5-Jan-07 4:22
sitebuilderLuc Pattyn5-Jan-07 4:22 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 20:15
JoeRip4-Jan-07 20:15 
GeneralRe: Do you know of a MS COM object that raises events? Pin
JoeRip4-Jan-07 20:20
JoeRip4-Jan-07 20:20 
QuestionVirus Pin
Tyler454-Jan-07 15:45
Tyler454-Jan-07 15:45 
AnswerRe: Virus [modified] Pin
Vega024-Jan-07 16:06
Vega024-Jan-07 16:06 
AnswerRe: Virus Pin
leppie4-Jan-07 16:54
leppie4-Jan-07 16:54 
AnswerRe: Virus Pin
Christian Graus4-Jan-07 18:03
protectorChristian Graus4-Jan-07 18:03 
QuestionRe: Virus Pin
Tyler454-Jan-07 18:58
Tyler454-Jan-07 18:58 
AnswerRe: Virus Pin
Chris Buckett4-Jan-07 21:13
Chris Buckett4-Jan-07 21:13 
AnswerRe: Virus Pin
Hamid_RT4-Jan-07 18:44
Hamid_RT4-Jan-07 18:44 
AnswerRe: Virus Pin
Tyler454-Jan-07 20:34
Tyler454-Jan-07 20:34 
GeneralRe: Virus Pin
Pete O'Hanlon4-Jan-07 22:26
mvePete O'Hanlon4-Jan-07 22:26 
AnswerRe: Virus Pin
Mircea Puiu4-Jan-07 20:49
Mircea Puiu4-Jan-07 20:49 
AnswerRe: Virus Pin
lost in transition 5-Jan-07 4:06
lost in transition 5-Jan-07 4:06 
Questionend of line character Y position Pin
netJP12L4-Jan-07 11:15
netJP12L4-Jan-07 11:15 
AnswerRe: end of line character Y position Pin
Christian Graus4-Jan-07 11:30
protectorChristian Graus4-Jan-07 11:30 

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.