Click here to Skip to main content
15,894,410 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: How to get multiple selected items from listbox Pin
Richard Parsons8-May-06 3:42
Richard Parsons8-May-06 3:42 
Questionhow to print the webform Pin
an_wingel8-May-06 0:22
an_wingel8-May-06 0:22 
AnswerRe: how to print the webform Pin
Lexa19838-May-06 2:07
Lexa19838-May-06 2:07 
GeneralRe: how to print the webform Pin
an_wingel8-May-06 4:36
an_wingel8-May-06 4:36 
AnswerRe: how to print the webform Pin
Guffa8-May-06 20:43
Guffa8-May-06 20:43 
QuestionAsynCallback Pin
yongwpi7-May-06 9:28
yongwpi7-May-06 9:28 
AnswerRe: AsynCallback Pin
Phillip M. Hoff7-May-06 19:03
Phillip M. Hoff7-May-06 19:03 
GeneralRe: AsynCallback Pin
yongwpi8-May-06 6:51
yongwpi8-May-06 6:51 
Thanks for your reply. So you mean that in .net cf, BeginInvoke() and EndInvoke are not supported. But as I opened a new thread, I can use BeginInvoke() and EndInvoke(). Here comes the source code.

button_click(....)
{
...
Thread myThread = new Thread(new ThreadStart(myThreadMethod));

myThread.Start;
}

myThreadMethod()
{

this.BeginInvoke(delegate, object)
}

I posted the detail of my question with some source code below, and thanks for your help.

I am using Asyncallback in .net CF development in a button_click event. There is no problem when I deploy the program, but as I click the button, error occured. The message is 'An unhandled exception of type 'System.NotSupportedException' occurred in System.Windows.Forms.dll', and it stopped at 'application.run(new form())' I used the begininvoke to start the callback, and endinvoke to get the result. I used ppc 2003 emulator, and vs2005. Thanks for your help.

Here comes part of my code:

private delegate int CalcDelegate(int input1, int input2, ref string strResult);

CalcDelegate mDeleg;
private void button1_Click(object sender, System.EventArgs e)
{
mDeleg = new CalcDelegate(Calc);

int input1 = Convert.ToInt16(textBox1.Text);
int input2 = Convert.ToInt16(textBox2.Text);
string strResult = null; // dummy parameter
AsyncCallback cb = new AsyncCallback(CalcCallback);
IAsyncResult ar = mDeleg.BeginInvoke(input1, input2, ref strResult, cb, null);
Thread.Sleep(1000);
}

private void CalcCallback(IAsyncResult ar)
{
string result=null;
int output = mDeleg.EndInvoke(ref result, ar);
textBox3.Text = output.ToString();
}

if I could not use BeginInvoke() and EndInvoke(), how can I change this code? Thanks.
GeneralRe: AsynCallback Pin
Phillip M. Hoff8-May-06 19:10
Phillip M. Hoff8-May-06 19:10 
GeneralRe: AsynCallback Pin
yongwpi9-May-06 7:55
yongwpi9-May-06 7:55 
QuestionInteoperatability between vc++ and c# Pin
Ashraj19826-May-06 0:54
Ashraj19826-May-06 0:54 
AnswerRe: Inteoperatability between vc++ and c# Pin
Fu Manchu9-May-06 3:38
Fu Manchu9-May-06 3:38 
Question.Net Controls Pin
rahultaing5-May-06 17:35
rahultaing5-May-06 17:35 
AnswerRe: .Net Controls Pin
Josh Smith6-May-06 6:15
Josh Smith6-May-06 6:15 
AnswerRe: .Net Controls Pin
Richard Parsons8-May-06 3:48
Richard Parsons8-May-06 3:48 
QuestionProblem with Reference to assembly Pin
@myg@l5-May-06 4:05
@myg@l5-May-06 4:05 
AnswerRe: Problem with Reference to assembly Pin
Josh Smith5-May-06 4:28
Josh Smith5-May-06 4:28 
GeneralRe: Problem with Reference to assembly Pin
@myg@l5-May-06 4:36
@myg@l5-May-06 4:36 
GeneralRe: Problem with Reference to assembly Pin
Josh Smith5-May-06 5:05
Josh Smith5-May-06 5:05 
GeneralRe: Problem with Reference to assembly Pin
@myg@l5-May-06 17:36
@myg@l5-May-06 17:36 
GeneralRe: Problem with Reference to assembly Pin
Robert Rohde5-May-06 20:44
Robert Rohde5-May-06 20:44 
GeneralRe: Problem with Reference to assembly Pin
@myg@l5-May-06 23:12
@myg@l5-May-06 23:12 
GeneralRe: Problem with Reference to assembly Pin
Robert Rohde6-May-06 21:41
Robert Rohde6-May-06 21:41 
GeneralRe: Problem with Reference to assembly Pin
@myg@l7-May-06 4:32
@myg@l7-May-06 4:32 
GeneralRe: Problem with Reference to assembly Pin
Robert Rohde7-May-06 5:41
Robert Rohde7-May-06 5:41 

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.