Click here to Skip to main content
15,905,238 members
Home / Discussions / C#
   

C#

 
Questionsteganography implemented in c sharp Pin
dhananjaysonar31-Mar-07 3:56
dhananjaysonar31-Mar-07 3:56 
AnswerRe: steganography implemented in c sharp Pin
Vasudevan Deepak Kumar31-Mar-07 4:25
Vasudevan Deepak Kumar31-Mar-07 4:25 
GeneralRe: steganography implemented in c sharp Pin
dhananjaysonar31-Mar-07 4:45
dhananjaysonar31-Mar-07 4:45 
GeneralRe: steganography implemented in c sharp Pin
Vega0231-Mar-07 6:29
Vega0231-Mar-07 6:29 
GeneralRe: steganography implemented in c sharp Pin
Colin Angus Mackay31-Mar-07 7:17
Colin Angus Mackay31-Mar-07 7:17 
AnswerRe: steganography implemented in c sharp Pin
Stefan Troschuetz31-Mar-07 5:49
Stefan Troschuetz31-Mar-07 5:49 
Questioninvoking a function with string[] Pin
ceken31-Mar-07 3:30
ceken31-Mar-07 3:30 
AnswerRe: invoking a function with string[] Pin
Leslie Sanford31-Mar-07 6:03
Leslie Sanford31-Mar-07 6:03 
Check out the signature for Control.BeginInvoke Method (Delegate, Object[])[^]. Notice the second parameter. It's modified with the params keyword, which means that you can pass zero to many parameters in addition to the delegate.

(actually, if you don't pass any additional arguments to BeginInvoke, I'm assuming that Control.BeginInvoke Method (Delegate)[^] is called instead.)

So when you want to pass an array of strings to BeginInvoke, do this:

this.BeginInvoke(writeTb, new object { veri });


This makes the entire string array a single argument that can be passed to your callback method.

Now, why does the integer array work when the string array does not? I think it has to do with the string array being an array of reference types. The BeginInvoke method is seperating out, for lack of a better word, each element of the array and treating them as seperate objects instead of treating the array as a single object.

So the compiler is interpretting the call to BeginInvoke as:

this.BeginInvoke(writeTb, "data1", "data2");


Two parameters are getting passed to your callback instead of one, which is where the mismatch exception is being thrown.

I'm guessing that the reason that the integer array doesn't have the problem is that the compiler is treating it as one object.
GeneralRe: invoking a function with string[] Pin
ceken1-Apr-07 9:46
ceken1-Apr-07 9:46 
GeneralRe: invoking a function with string[] Pin
Leslie Sanford1-Apr-07 11:51
Leslie Sanford1-Apr-07 11:51 
QuestionCalling AddIn functions Pin
swje31-Mar-07 2:55
swje31-Mar-07 2:55 
AnswerRe: Calling AddIn functions Pin
Judah Gabriel Himango31-Mar-07 9:09
sponsorJudah Gabriel Himango31-Mar-07 9:09 
QuestionFileSize on a Website Pin
Kitchen_31-Mar-07 2:16
Kitchen_31-Mar-07 2:16 
AnswerRe: FileSize on a Website Pin
Dave Kreskowiak31-Mar-07 7:50
mveDave Kreskowiak31-Mar-07 7:50 
AnswerRe: FileSize on a Website Pin
Vasudevan Deepak Kumar1-Apr-07 5:32
Vasudevan Deepak Kumar1-Apr-07 5:32 
AnswerRe: FileSize on a Website Pin
Kitchen_1-Apr-07 14:30
Kitchen_1-Apr-07 14:30 
QuestionHow can I intercept a click in a WebBrowser Control? Pin
MaryGeorge31-Mar-07 2:01
MaryGeorge31-Mar-07 2:01 
AnswerRe: How can I intercept a click in a WebBrowser Control? Pin
Vasudevan Deepak Kumar1-Apr-07 5:38
Vasudevan Deepak Kumar1-Apr-07 5:38 
GeneralRe: How can I intercept a click in a WebBrowser Control? Pin
MaryGeorge2-Apr-07 3:33
MaryGeorge2-Apr-07 3:33 
QuestionSystem.Reflection.Emit.EventBuilder Pin
cybertone31-Mar-07 1:59
cybertone31-Mar-07 1:59 
AnswerRe: System.Reflection.Emit.EventBuilder Pin
Vasudevan Deepak Kumar1-Apr-07 5:42
Vasudevan Deepak Kumar1-Apr-07 5:42 
QuestionRe: System.Reflection.Emit.EventBuilder Pin
cybertone1-Apr-07 20:30
cybertone1-Apr-07 20:30 
QuestionGood old StringGrid Pin
Dewald30-Mar-07 23:37
Dewald30-Mar-07 23:37 
QuestionRe: Good old StringGrid Pin
Noman Aftab31-Mar-07 0:50
Noman Aftab31-Mar-07 0:50 
AnswerRe: Good old StringGrid Pin
Dewald31-Mar-07 1:10
Dewald31-Mar-07 1:10 

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.