|
Start with the async design pattern[^]
Then use background workers, threads, or the thread pool to achieve your operations on a different thread.
Simon
|
|
|
|
|
Thanks Simon,
I have read up all the stuff you recommended below,
http://msdn.microsoft.com/en-us/library/aa719595(VS.71).aspx
Two more questions about the link,
1.
What means "containers that support waiting on objects"? Could you show me the which API/Class it means please?
2.
For the sample "Do not supply the callback delegate when beginning asynchronous operation" -- I read it but confused. The sample said "Do not supply the callback", but actually in the code callback is supplied here, any comments?
IAsyncResult asyncResult = primeFactorizer.BeginFactorize(
factorizableNum,
ref primefactor1,
ref primefactor2,
callback,
state);
3.
The document mentioned IMessage, actually I have never used it and not found quite good stuff on MSDN. Could you describe or recommend some good stuff to describe what IMessage is and how to use it?
regards,
George
|
|
|
|
|
chat sample code often use that, try to check here in code project maybe you will get lucky (luke)
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
What means "chat sample code"? Could you provide some links please?
regards,
George
|
|
|
|
|
I mean chat applications like the windows live messenger.
You can download here in codeproject sample code about it. Chat application need a lot of thread management because of the "clients" (asynchronous or synchronous connections), maybe helpfull for you.
Just type "chat" in search textbox up in this page, you will get lots of articles. I dont really know the best for you, better open all and collect the code you need for your project.
nelsonpaixao@yahoo.com.br
trying to help & get help
|
|
|
|
|
Thanks nelsonpaixao,
Do you have any good stuff to recommended? I have found some but not interested in UI. I do not need UI. If there are some samples or documents which describe how to implement asynchronous pattern will be great!
Any recommendations?
regards,
George
|
|
|
|
|
i would like my application redirect after login.
Url: http://mySite.com/Login.aspx?ReturnUrl=http%3a%2f%2fmySite.com%2fpage.aspx%3f%26pid%3d1111%26%23Write
But don't know why the application return a error: A potentially dangerous Request.QueryString value was detected from the client (ReturnUrl="...1111&#Write").
Could anyone help?
modified on Thursday, October 9, 2008 5:12 AM
|
|
|
|
|
I think that it's the http:// part of the data that it reacts on. Try to use a relative url instead of a fully qualified url.
Otherwise you can turn of ValidateRequest in the @Page directive.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Because some idiot thought it would be fun to make ASP.Net websites crash randomly. This ill-designed "protection" is causing more harm than good in each and every website where it's not turned off.
And now it seems in ASP.Net MVC 2 it can't be turned off. I've already modified web.config and this idiotic message still appears.
Hey dude, I ain't ever gonna include that value unescaped in the HTML, shut the heck up!
|
|
|
|
|
Greetings to all!
I have a genric list of UIElements.
A Method passes me two variables:
the direction represented by an integer (+1 or -1)
and the type of the last used object in the list.
I need to find out the index of the last object and get the next one.
eg.:
List<uielements> _list = new List<uielements>(){new Dialog1(), new Dialog2(), new Dialog3()};
internal UIElement GiveNavigationItem(int p, Type lastElement)
{
var result = from o in _list
where o.GetType() == lastElement
select o;
return _list[result + p];
}</uielements></uielements>
Thank you in advance!
eza
|
|
|
|
|
Your using generics right?
You need to replace all the "<" and ">" signs in your post with "<" and ">". There's two buttons below the text box to help you. this will make your post easier to understand.
Simon
|
|
|
|
|
Unless I completely misunderstand what you want, just use this to get the last index:
int lastIndex = _list.Count - 1;
I'm not sure how you can get "the next one" if you're starting at the last index, because there is no "next one".
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Let's say I have the List with 5 Elements.
Bound is the one with the Number 4 and I receive the command "+1"/"oldType(element4)"
So I need to check which is the Index of oldType in the list (it's 4) and check if there is a 5 as well.
Yes, it is, so return the Element with the Index 5.
Now I have Number 5 bound and reveive a command "+1"/"oldType(element5)"
Check again the Index of the oldType I find out it's 5.
Now check again if there's a 6 -> no, so keep the old Control.
Otherewise -1 would work.
This lokks like this:
(-) [Container] (+)
and the Control is loaded inside the Container. + gets the next one (if available) - the previous one
Anyway I got my hint for this problem alreadyand I could solve it. Thank you for your help.
|
|
|
|
|
here you go:
static UIElement GiveNavigationItem(int p, Type lastElement)
{
var result = (from o in _list
where o.GetType() == lastElement
select _list[_list.IndexOf(o) + p]).FirstOrDefault();
return result;
}
|
|
|
|
|
Thank you! That solves my problem!
|
|
|
|
|
hi friends ,
I had a project to draw on a panel..I used draw line method and draw rectangle method to for drawing.It was on 2003.I converted it into 2005.But now it is showing high flickering.Is there any way to avoid flickering ?
with warm regards
Dyno
|
|
|
|
|
Well Denver,
If you do a little searching yourself on CodeProject it will give you numerous solutions in a couple of seconds.....
But since I'm already answering your request, here we go:
have you tried the following:
Make a new class that inherites from panel control.
Override the OnPaintBackground and OnPaint methods.
Setting the ControlStyles.DoubleBuffer property on the panel might do the trick as well.
This site might help too:
http://www.codeproject.com/KB/GDI-plus/flicker_free.aspx
Happy coding.
modified on Thursday, October 9, 2008 3:08 AM
|
|
|
|
|
|
Assume this function:
private void Changing(int[] is, int i)
{
is[0] = 100;
i = 100;
}
When I call Changing in Main:
static void Main()
{
int[] is = {0, 1, 2, 3, 4};
int i = 0;
Console.WriteLine(i);
Console.WriteLine(is[0]);
Changing(is, i);
Console.WriteLine(i);
Console.WriteLine(is[0]);
}
is changed but i didn't, why?
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Arrays in C# fall in the category of reference types. Like any other reference type, an array object refers to a memory space allocated on the heap.
If you want to deep knowledge then go to Google for Value Type vs Reference Type.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Ok, I got it, Tha nks
While (true) { Human.isLearnable = true; }
|
|
|
|
|
Hi, I am using VS C# 08 Express Edition and I have a personal web browser that I've almost finished, and on Form1_Load the web browser will goto my custom homepage. But I am not sure how to go about this. I want to have the HTML file that I've created to either be installed with the program when someone installs my program or have it embeded into the .Exe file somehow, is either way possible? Can somebody please explain how to do this? Thanks in advance
regards,
jt
|
|
|
|
|
jay_t55 wrote: when someone installs my program or have it embeded into the .Exe file somehow, is either way possible?
yes it's possible.
if you want your html file to be installed with your program, just add it to your installer. otherwise you can include that file as embedded resource in your application and get the stream of your resource with YourAssembly.GetManifestResourceStream(YourEmbeddedFileResourceName).
hope it helps
dhaim
programming is a hobby that make some money as side effect
|
|
|
|
|
Thanks mate, i appreciate your help! I spent about three weeks trying to figure that one out (i'm a newbie)
|
|
|
|
|
I've ran into a subtle but problematic issue with the DataGridView saving a new row. I have a databound dgv stored in a UserControl and when the user enters values into a field, the values are not updated when the UserControl is closed (removed from the form). To save time I won't do into an explanation on why the dgv resides in a UserControl but I promise that there is a legitimate reason. Does anyone know how to force the dgv to save state of the new row being edited? If the user enters values into a new row and moves to another row, the state is saved but I can't depend on that happening in a real world situation. I have tried: dgv.NotifyCurrentCellDirty(), dgv.EndEdit() etc and nothing is working.
Here is how to replicate this issue. (Maybe a bug)
Try dropping a dgv that is bound to a dataTable into a UserControl. Now drop the UC inside a Form. Have a MenuStrip item that can be clicked to remove the UserControl from the form. Run the application and add some text to the new row at the bottom. Now without moving the cursor to another cell, click the MenuStrip to remove the UserControl. Now run the program again and the new row's state will not be saved. Enter some text again into the new row at the bottom and close the Form this time. The new row should save state this time.
Thanks for any help that can be provided.
Richard
I've used up all my sick days, so today I'm calling in dead.
|
|
|
|