Click here to Skip to main content
15,890,282 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to create shape file in C# Pin
Christian Graus14-Aug-07 19:32
protectorChristian Graus14-Aug-07 19:32 
GeneralRe: How to create shape file in C# Pin
ssliew14-Aug-07 19:35
ssliew14-Aug-07 19:35 
GeneralRe: How to create shape file in C# Pin
Christian Graus14-Aug-07 19:37
protectorChristian Graus14-Aug-07 19:37 
GeneralRe: How to create shape file in C# Pin
ssliew15-Aug-07 15:28
ssliew15-Aug-07 15:28 
Questionproblem about MS Word Pin
kcynic14-Aug-07 17:30
kcynic14-Aug-07 17:30 
AnswerRe: problem about MS Word Pin
Malcolm Smart14-Aug-07 21:20
Malcolm Smart14-Aug-07 21:20 
GeneralRe: problem about MS Word Pin
kcynic15-Aug-07 5:17
kcynic15-Aug-07 5:17 
QuestionIAsynResult problem - hit a brick wall Pin
Glen Harvy14-Aug-07 17:26
Glen Harvy14-Aug-07 17:26 
Hi,

I have a project that needs to do many, many DNS lookups. I have done a bit of reseach and come up with the following code:
      for (int x = 0; x < hostList.Count; x++)
      {
        //IAsyncResult ar = getIP.BeginInvoke(hostList[x],null,null); <-- this works but I can't 
figure out how to get the delegated method to update a datatable or an array in the main thread.

        getIP.BeginInvoke(hostList[x], new AsyncCallback(MyCallback), getIP); 
      }

The call back is:
void MyCallback(IAsyncResult ar)
{
  getDNS getIP = (getDNS)ar.AsyncState;
  string result = getIP.EndInvoke(ar);
  MessageBox.Show(result); <-- just so I know it works - testing purpose.
}

I now have the problem that I can't reference the original object/string passed to 'ar' so that I can match it up with the result and then update the datatable (or array or whatever).

I originally considered backgroundworkers to do the job but I think that is overkill. Surely I can achieve what I want with the IAsyncResult.

If anyone care to comment or make suggestions so I can get past this brick wall it would be much appreciated.


Thanks.

Glen Harvy

AnswerRe: IAsynResult problem - hit a brick wall Pin
Leslie Sanford14-Aug-07 17:58
Leslie Sanford14-Aug-07 17:58 
GeneralRe: IAsynResult problem - hit a brick wall Pin
Glen Harvy14-Aug-07 19:15
Glen Harvy14-Aug-07 19:15 
GeneralRe: IAsynResult problem - hit a brick wall Pin
pbraun14-Aug-07 19:36
pbraun14-Aug-07 19:36 
GeneralRe: IAsynResult problem - hit a brick wall Pin
Glen Harvy14-Aug-07 23:20
Glen Harvy14-Aug-07 23:20 
GeneralRe: IAsynResult problem - hit a brick wall Pin
pbraun15-Aug-07 5:09
pbraun15-Aug-07 5:09 
GeneralRe: IAsynResult problem - hit a brick wall Pin
Glen Harvy15-Aug-07 10:50
Glen Harvy15-Aug-07 10:50 
GeneralRe: IAsynResult problem - hit a brick wall Pin
pbraun15-Aug-07 11:43
pbraun15-Aug-07 11:43 
GeneralRe: IAsynResult problem - hit a brick wall [modified] Pin
Glen Harvy14-Aug-07 23:09
Glen Harvy14-Aug-07 23:09 
GeneralRe: IAsynResult problem - hit a brick wall Pin
Leslie Sanford15-Aug-07 5:15
Leslie Sanford15-Aug-07 5:15 
GeneralRe: IAsynResult problem - hit a brick wall Pin
Glen Harvy15-Aug-07 11:00
Glen Harvy15-Aug-07 11:00 
QuestionHow to comunicate with CD printer Pin
Richard Blythe14-Aug-07 16:03
Richard Blythe14-Aug-07 16:03 
AnswerRe: How to comunicate with CD printer Pin
Christian Graus14-Aug-07 17:03
protectorChristian Graus14-Aug-07 17:03 
QuestionSourcegrid Installation Pin
Papi83dm14-Aug-07 12:57
Papi83dm14-Aug-07 12:57 
AnswerRe: Sourcegrid Installation Pin
Ed.Poore14-Aug-07 15:09
Ed.Poore14-Aug-07 15:09 
AnswerRe: Sourcegrid Installation Pin
Christian Graus14-Aug-07 17:03
protectorChristian Graus14-Aug-07 17:03 
AnswerRe: Sourcegrid Installation Pin
Papi83dm15-Aug-07 2:52
Papi83dm15-Aug-07 2:52 
QuestionReplace umlauts Pin
SilverV14-Aug-07 12:32
SilverV14-Aug-07 12:32 

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.