|
hello
BadKarma wrote: every callback instantiates a thread
Pardon me but, I totaly disagree. Delegates don't make threads by themselves unless you call them asynchronously. Here is a small demo:
private delegate void MyDel();
MyDel NewDel;
Form1()
{
NewDel = new MyDel(MyDelMethod);
}
void MyLink_Click(object sender, EventArgs e)
{
for (int i = 0; i < 5; i++)
Invoke(NewDel);
}
private void MyDelMethod()
{
MessageBox.Show("Hello");
}
You will see that the Invoke call is blocked by the Messagebox.Show and the second message isn't shown until you close the previous one. Also because the Invoke was called from the main thread, you will see that the UI is blocked as well.
Regards
|
|
|
|
|
Hi,
you are right
thanks for reminding me that delegates can also be used in singlethreaded manner
(i've been stuck for a little while with inner thread communication using delegates, which is a resource bloat )
codito ergo sum
|
|
|
|
|
well, basically, is there any way to force the gui to update without delegates?
the only way i can currently think of is by having the gui update itself on a timer.
then have a flag that sets true when there are changes to be made.
|
|
|
|
|
Hello
lushgrass wrote: is there any way to force the gui to update without delegates?
Usually any changes made to your controls' contents -like adding/removing items, etc...- are automatically updated and viewed. Yet you can force your UI to refresh itself using Refresh() method.
lushgrass wrote: the only way i can currently think of is by having the gui update itself on a timer.
You can issue Refresh() or Invalidate() calls from methods that alter the content of a certain control only to that control. Yet again if you still want to refresh your entire UI, no problem!
lushgrass wrote: then have a flag that sets true when there are changes to be made.
In the old times we called that bool modified in the document class of MFC, but why use it in C#?? I'm sure you don't need all that complexity!!
Regards
|
|
|
|
|
HI
Just i want to know the want is the use of singletone class and please write a simple code to create a sinlgetone class and and how its implement.
Thanks in advance.
Thanks n Regard,
Srinandan
|
|
|
|
|
There are tons of information on this topic in the internet. Try googling.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
|
|
Hi,
I have created a DirectShow COM dll in VB 6. The purpose of this DLL is to trim the source media file with given start and end time and produce new clip.
I am able to use this COM dll from C# Windows application cofortably. However, I cant use it from WEB application. The code is same in both Windows and Web application. It does not give any error or exception but does not work at all. This is true for my other VC++ COM dll where is gives "DLL Initialization routine failed" error. I am able to use other COM dll in Web application easily
Is there some problem with DirectShow in .Net Web application ? Whats the way out ? Is there other way to edit AVI in .Net?
Please Help
Thanks
Milind
|
|
|
|
|
I am using Visual Studio 2003 with .NET framework 1.1. I want to play flash files in Picturebox. How can i do that?
Thanks,
Sandeep S. Sekhon
|
|
|
|
|
Actually I don't know how to play it in PictureBox but if you are not insisting on using it u can add it using the object tag as in the example
<object>
<embed src="whatever.swf" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
</object>
Hope this works out with you.
Mohamed El Gohary
|
|
|
|
|
U can't do that...
U have to use a WebBrowser to play flash files.
Regards,
Everyone is a genius at least once a year - Pramod
|
|
|
|
|
I am building a Windows Forms Application. Please tell me how can I play Flash file in it.
Thanks,
Sandeep S. Sekhon
|
|
|
|
|
Use the activeX browser control in axinterop.shdocvw.dll to embed an ie window in your app, then put the html page with the flash player in the control.
|
|
|
|
|
Just place a webBrowser from the toolbox and
call the Navigate method of the webbrowser,
Pass the file path of the flash file in the Navigate method.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
Hi gorgeous Programmers
How can I get text from image file?
Thank in Advance
|
|
|
|
|
M Riaz Bashir wrote: How can I get text from image file
Start with a decent description of what you are trying to achieve! 1 line questions rarely get a meaningful or useful answer.
|
|
|
|
|
hi all,
how can i convert an 32bit bitmap image to a 1bit bitmap image with using C# ?
thanks in advance,
bye.
MFA
|
|
|
|
|
1) Open the bitmap
2) Create a new bitmap with the same height / width and 16 bpp
3) Draw the original image onto the new bitmap's Graphics object
4) Save
using (Bitmap original = new Bitmap(filename))
{
using (Bitmap newone = new Bitmap(original.Width, original.Height, PixelFormat.16bppRgb))
{
using (Graphics gfx = Graphics.FromImage(newone))
{
gfx.DrawImage(original, 0, 0);
}
newone.Save(outputfile, ImageFormat.Bmp);
}
}
-- modified at 8:27 Tuesday 29th August, 2006
<div class="ForumSig"><hr>Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog<sup><font color="green">9</font></sup>
Ed</div>
|
|
|
|
|
i need to write a code which would retrieve the information about the webcontrols in a webpage. i need to know the count and also what type of controls. i know that System.Reflection namespace can be used. but i do not know what class to use. can anybody help??
Sonu
|
|
|
|
|
I think you are in a wrong forum and also don't cross post.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi All Respected Programmers
Kindly give me the method that, How may I get another form's textbox value into current textbox?
Thank in Advance
|
|
|
|
|
|
|