Passing data from a static method?
-
Hi, How will I be able to pass data I get back in a static Callback to a parameter in the same form-class? public class TestForm : System.Windows.Forms.Form { public sting result; ... ... public static void ParseResult(IAsyncResult arResult) { //This is what I want to do but it doesn't work! this.result = "test!"; } ... ... } /Dalle
-
Hi, How will I be able to pass data I get back in a static Callback to a parameter in the same form-class? public class TestForm : System.Windows.Forms.Form { public sting result; ... ... public static void ParseResult(IAsyncResult arResult) { //This is what I want to do but it doesn't work! this.result = "test!"; } ... ... } /Dalle
-
Hi, How will I be able to pass data I get back in a static Callback to a parameter in the same form-class? public class TestForm : System.Windows.Forms.Form { public sting result; ... ... public static void ParseResult(IAsyncResult arResult) { //This is what I want to do but it doesn't work! this.result = "test!"; } ... ... } /Dalle
I'm not very familiar with asynchronous execution but I think the following should work: When beginning the asynchronous call pass the actual instance of TestForm as state object and retrieve it in the callback by using the
IAsyncResult.AsyncState
property.