Re: Threading on Functions returning values



Hi Mr.Peter,

Thank you for responding to my request of coding. I am very glad and happy
to add in this forum. People like you are very Important for this forum.
From the below code which you have send me I could able to solve my problem,
Thank very much for this code. I hope I could also help others in the same
way like you did.


Thanking You,

With Regards,
A.K.Seerajdeen,
Emp ID: NGV33051,
Jr. Software Programmer,
Nanna Computers (Vizag),
Tel: +919885444639,
siraj@xxxxxxxxxxxxxxxxxxx

(This electronic message contains information from Nanna Computers, which
may be privileged or confidential. The information is for the intended
individual(s) or entity named above. If you are not the intended recipient
be aware that any copying, disclosing, distribution or use of the above
email and/or its attachments is prohibited and is illegal. If you have
received this electronic message in error, please notify us by telephone or
email (to the numbers or address above) immediately. This e-mail is not
un-solicited e-mail under the relevant regulations.)




As an example:

delegate string MyDelegate();

void InvokingMethod()
{
string strT;

strT = (string)this.Invoke((MyDelegate)InvokedMethod);
}

string InvokedMethod()
{
return "This is a test string";
}

In other words, it works just like calling a method directly, in that when
the delegate returns a value, so too does the Invoke() method. Just cast
the return value from Invoke() to whatever you need, and as long as the
cast matches the actual return type of the invoked method, it will work
fine.

If the above does not solve the issue, I recommend that you read the MSDN
documentation on delegates as well as the Control.Invoke() method. If you
still have questions, please feel free to post them, but do make sure that
the questions are specific enough to be able to answered in a
straight-forward way. It would be especially useful if you phrase the
question in terms of what in the documentation you are having trouble
understanding.

Peter..


.



Relevant Pages

  • Re: ComboBox text Property
    ... DataReceived event, then (see my example using a Delegate) Invoke or ... combo and to send that string when you see a specific character. ...
    (microsoft.public.dotnet.languages.vb.controls)
  • Re: ComboBox text Property
    ... then (see my example using a Delegate) Invoke or ... BeginInvoke syntax is demanded. ... combo and to send that string when you see a specific character. ...
    (microsoft.public.dotnet.languages.vb.controls)
  • Re: ouvrir un document word =?ISO-8859-1?Q?=E0_partir_d=27un?= =?ISO-8859-1?Q?_progr
    ... invoke theDocument "getParagraphs" returning theParagraphs ... move String1 to ws-SendText ... *> The final string is converted to an object if required ... depending on ls-OUT-Length pic x. ...
    (comp.lang.cobol)
  • Re: Convert.FromBase64String() and ViewState
    ... Asp.Net serializes ‘C’ ... into Base64 string. ... if you post in an appropriate forum, ... each character in the deserialized output. ...
    (microsoft.public.dotnet.languages.csharp)
  • Strange error validating XML against XSD
    ... This method has one parameter (string your_data). ... value that this parameter will actually have is the content of a XML ... invokes my web method and it fails exactly when the XSD is performed. ... But when these guys invoke the method, ...
    (microsoft.public.dotnet.framework.webservices)