473,326 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Asyncronous problem

Hi,

I made an application that foreach directory that found in the hardisk
create a node into a treeview.

Of course, to avoid that the user interface gets blocked, i use a handler in
a syncronous way.

The problem is that when i execute the application and click a button to
fill the treeview, dont fill anything.

This is my code inside the Onclick method of the button:

GetHTMLHandler handler = new GetHTMLHandler(Begin);
AsyncCallback cb = new AsyncCallback(this.Finish);
handler.BeginInvoke("Root",this.textBox1.Text,cb, null);

But if i call to the application in a syncronous way, the treeview is filled
perfect (but with the blocked of the graphic interface)

What im doing wrong, i think that there is anything wrong with the threads,
but i dont know clearly what it is.
--
Thanks a lot.
Regards.
Josema
Jun 27 '06 #1
1 1214
Josema,

I assume you are doing this in ASP.NET, as you have a class named
GetHTMLHandler.

What is happening in this case is that your method is running
asynchronously, and then your response is returning.

Then, your asynchronous call is returning, but your response has been
sent, hence the reason it is empty.

With ASP.NET applications, ultimately, your processing has to complete
before the page is returned.

If you have a good amount of information, then I recommend that you use
something like AJAX, sending only the top level of the directory structure
back. Then, when the folder is opened, you can get the contents of that
directory, and so on, and so on.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Josema" <Je******@ocu.org> wrote in message
news:DD**********************************@microsof t.com...
Hi,

I made an application that foreach directory that found in the hardisk
create a node into a treeview.

Of course, to avoid that the user interface gets blocked, i use a handler
in
a syncronous way.

The problem is that when i execute the application and click a button to
fill the treeview, dont fill anything.

This is my code inside the Onclick method of the button:

GetHTMLHandler handler = new GetHTMLHandler(Begin);
AsyncCallback cb = new AsyncCallback(this.Finish);
handler.BeginInvoke("Root",this.textBox1.Text,cb, null);

But if i call to the application in a syncronous way, the treeview is
filled
perfect (but with the blocked of the graphic interface)

What im doing wrong, i think that there is anything wrong with the
threads,
but i dont know clearly what it is.
--
Thanks a lot.
Regards.
Josema

Jun 27 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ivar | last post by:
Hi, Is SocketOptionName.ReciveTimeout usable with asyncronous socket methods ? With Recive method it works but BeginRecive can't get it working.
0
by: Andrés Joaquín | last post by:
Hello, I have a problem with a TCP Asyncronous Server Implementation. I take the solution from the Microsoft Site (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht...
1
by: Nathan | last post by:
On my .NET web project I am trying to make an asyncronous call to a function using IAsyncResult. The function will process for about a 1/2 hour. before it completes, the process abruptly ends as...
1
by: alex002 | last post by:
Dear all, I am writing to a C# program to connect to the telnet server and getting data; however, I know that I can use either TCPClient and Asyncronous Socket to do the program. However, I...
0
by: Paul Fi | last post by:
what is the point of asyncronously processing requests or responses at channel sinks when we can do asyncronous calls at the .net remoting application level ? do we consider AsyncProcessResponse...
1
by: il RicercatoreSbadato | last post by:
title: asyncronous Socket and EndAccept() question: hi to all, I am working with a server that uses the sockets in a asyncronous way. When I want to STOP the server I do the following: -...
1
by: Allan Ebdrup | last post by:
I'm inside a function where I have a static cache, when the cache needs to be updated I want to do it asyncronously, because updating the cache takes a while. I want to use thread safety when...
0
by: Andrea Moro | last post by:
I've implemented the asyncronous mechanism in the webservice I've built, but there is a strange fact. The object that my callback class returns doesn't reflect any of the changes that I made in...
2
by: Murali | last post by:
Hi friends, in Javascript without using Microsoft.XMLHTTP how can i do Asyncronous operation ? any experts pls bye
3
by: OJ | last post by:
Hi, I have written a small C# 2.0 DLL which acts as a client to a Socket based server over the internet. I have written both synchronous and asynchronous methods to connect, send, and receive data...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.