|
The AsyncCallback object is a delegate. The delegate points to a method that is called when the work finishes executing asynchronously.
For example,
Action doWorkFunction = DoSomeWork;
doWorkFunction.BeginInvoke(OnDoWorkCompletedAsync, null);
void DoSomeWork()
{
...
}
void OnDoWorkCompletedAsync(IAsyncResult result)
{
}
OnDoWorkComkpletedAsync will be called when DoSomeWork finishes asynchronously.
|
|
|
|
|
Hi,
Here is a good example
Regards,
Charith Jayasundara
|
|
|
|
|
Exactly what is the example? If you are going to respond, make sure you include links, copies of code, etc.
|
|
|
|
|
|
i need a client/server chat application that use it through internet (like Yahoo messenger),
i want to start server in my system and user(s) start client and chat together over internet, i want csharp code smaple and exe sample, can anybody help me (sample app or article)?
thanks
|
|
|
|
|
|
thanks Gareth
but i saw your link and it works in local network while i want work through internet.(not local network)
|
|
|
|
|
There is no difference in internet or intranet tcp/ip networking.
Just start the server up locally, if you have a router, you have to forward the needed ports to the server Computer.
The clients can connect to your Internet-ip.
|
|
|
|
|
|
Every....three.....days......
|
|
|
|
|
Hi All
Iwont to Use The WorkFlow In C#.Net , but i dont konw any thing abut it , who i can learn abut it
if any boudy know any web application It hellp me tell me it .
or if any boudy have any sample about it give me it .
Thanks about any hellp me
Thaer
|
|
|
|
|
There is actually a Windows Workflow forum here. See WPF/WCF/WF.
See here: http://netfx3.com/content/WFHome.aspx[^]
Also there are a number of short videos at MSDN Screencasts.
I have the book Pro WF by Bruce Bukovics which is very good.
Kevin
|
|
|
|
|
hi
i need to make Phone Dial in C#
is any one have sample code for it ?
thank's
|
|
|
|
|
|
not work !
is any one have asimple code for dial in c# ?
|
|
|
|
|
well, it probably depends on your phone.
you can connect to most phones using SerialPort (e.g. via bluetooth or usb virtual COM drivers).
next you`ll have to check out the AT command subset your phone supports.
then send those commands to your phone and you're finished,
/********************************************
* dies & das - dot & net
* http://blog.joachim.at
********************************************/
|
|
|
|
|
Hi...
I am writing a windows explorer toolbar that sets up a standard st of columns (like author, comments, etc..) so the user dosn't have to do it..(later will add more functions for handeling MS office documents etc..)
Now i have a working toolbar and have made my way through explorer to the lSysListView32 and using a LVCOLUMN managed to send the message that inserts the column..
But (allways a but) dose any one know how to tell explorer to populate the column with the info? I am only using standard columns (like author, comments, etc..)
Code So far...
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
MessageBox.Show("Button Clicked!");<br />
SendMessage(Explorer.HWND, LVM_COMMAND, viewREPORT, 0);<br />
IntPtr lSHELLDLLDefView = FindWindowEx(Explorer.HWND, 0, "SHELLDLL_DefView", null);<br />
if (lSHELLDLLDefView == null)<br />
{<br />
return;<br />
}<br />
IntPtr lDUIViewWndClassName = FindWindowEx(lSHELLDLLDefView, IntPtr.Zero, "DUIViewWndClassName", IntPtr.Zero);<br />
if (lDUIViewWndClassName == null)<br />
{<br />
return;<br />
}<br />
IntPtr lDirectUIHWND = FindWindowEx(lDUIViewWndClassName, IntPtr.Zero, "DirectUIHWND", IntPtr.Zero);<br />
if (lDirectUIHWND == null)<br />
{<br />
return;<br />
}<br />
IntPtr lCtrlNotifySink = FindWindowEx(lDirectUIHWND, IntPtr.Zero, "CtrlNotifySink", IntPtr.Zero);<br />
if (lCtrlNotifySink == null)<br />
{<br />
return;<br />
}<br />
IntPtr lSysListView32 = FindWindowEx(lCtrlNotifySink, IntPtr.Zero, "SysListView32", IntPtr.Zero);<br />
if (lSysListView32 == null)<br />
{<br />
return;<br />
}<br />
<br />
LVCOLUMN lvc = new LVCOLUMN();<br />
lvc.mask = 0x0001|0x0008|0x0002|0x0004;
lvc.fmt = 0x0001;<br />
lvc.cx = 100;<br />
lvc.text = "Author";<br />
<br />
int counter = 0;<br />
SendMessage(lSysListView32, 0x1000 + 97, counter, ref lvc);<br />
<br />
}
Not sure if this is the right forum but it is writen in C# but is probably more to do with good (well) old windows...
Many Thanks Calvin
|
|
|
|
|
This wont work. What you've done is told the listview to add the column, but Explorer doesn't know you did it and, hence, it wont fill the column.
You need to tell Explorer to add this column to the display so it also knows to fill in the data. The problem is there isn't a documented way to do this that I know of.
|
|
|
|
|
Ok.. I get it... I am looked into IShellBrowser.GetViewStateStream, but carn't seem to get it working in c#, so now i am looking into the registery settings... HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\BagMRU so i can make a button that aplies a template..
Filename,Author,subject,catagory, and comments.. are the column heading i want to set...
calvin streeting
|
|
|
|
|
Hello everyone,
Could anyone let me know why compiler can not make runtime error report in the following code, other than throw cast exception during runtime?
static void Main()
{
int i = 100;
object b = i;
long l = (long)b;
return;
}
thanks in advance,
George
|
|
|
|
|
What you are doing is unboxing b by casting it as a long - this happens at runtime.
Also i does not equal 100 - i is an object pointing to 100 which is why an error is thrown.
In short i is an object and not an int so casting it to int throws an error.
Continuous effort - not strength or intelligence - is the key to unlocking our potential.(Winston Churchill)
|
|
|
|
|
That is not the answer to his question.
that is just the reason why it gives a runtime exception.
the question was why there is no compiletime check.
And the short answer to that is that MS was too lazy to make the compiler check for those kinds of things.
All the information is right there in the code:
int i=1;
object o=i;
long l=(long)o;
So it should be perfectly possible to make compiler support to find the error.
Aand "lazy" might be the wrong word, the might just think that the developer should find such problems, that the complexity to implement it is greater than the benefit of the feature..
|
|
|
|
|
Thanks Roger,
What are the Microsoft compiler's rule to check type conversion issues -- even if compiler is "lazy", it should also has rule to check right/wrong?
regards,
George
|
|
|
|
|
Roger Alsing wrote: And the short answer to that is that MS was too lazy to make the compiler check for those kinds of things.
In the contrived example shown, yes, I can see that the compiler could potentially make the determination. But in the real world how many times do you have such a trivial example. Almost never, I'd recon.
In the real world the compiler couldn't tell what the object reference is likely to be at compile time. And if the object reference came in via an argument on a public method then it would never be able to make that determination because it could be called by code outside the assembly which the compiler would have zero knowledge of.
At the end of the day there is limited resources into making the product and I think it is a little disengenous to say that Microsoft are "too lazy" for producing a complier check that has increadibly limited scope in a real world environment.
|
|
|
|
|
Thanks Colin!
It is ok for me the compiler does not check everything even if our human can see.
My question is, I want to know what C# compiler check for type conversion (even if it is simple and can not find all the issues until runtime, I want to know the rules). Any ideas?
regards,
George
|
|
|
|