Looping and processing messages

G

Guest

Hi,

In traditional win32 programming, if for example I have to parse a large
bunch of data where I only need some fragments out, I should create a class
with a hidden window wich post a message to the window's WndProc who on his
part fire an event with the data part. Of course othere alternatives are, but
that's not the question. It is just one solution for particular problems and
it is very simple.

The question is what are the alternatives for this in .NET ?

1. Using P/Invoke for use PostMessage, override WndProc of the form and do
in fact the same.
2. Using a thread to handle all
3. Make a class that does it in a thread, and make an event handler for
every needed data part, eventually use Control.BeginInvoke or Control.Invoke
to synchronize with main thread.

Other alternatives ?
 
B

Bishoy Ghaly

Hi Wilfried,
Although what you was using was a good solution in the win32 point of
view but i do not recomment that you use the same way with .NET since .NET
is feature rich more than C++ and other passive languages, so my
recommindation is that you try doing your task with a THREAD , which is a
non blocking way to process other things and still keep the application
running (Asynchronos processing)
you need to creat a class to do the processing and make a parameter-less
methode inside this class and create a Thread for this methode and start
this thread

if you need any further help visit those links:
http://www.c-sharpcorner.com/Multithreading.asp
http://www.dotnetjunkies.com/Tutorial/64B74675-0C68-4536-9432-A69CF766EC8E.dcik
 
T

The Man With The Golden Gun

Wilfried said:
Hi,

In traditional win32 programming, if for example I have to parse a large
bunch of data where I only need some fragments out, I should create a
class with a hidden window wich post a message to the window's WndProc who

This sounds like an exact match for .net Remoting.

Have you looked at that?

Also, WSE 2.0 can perform that task as well -- but it's more http-ish and
you may want the speed and configurability of Remoting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top