|
Hi,
To get this implemented you need to have a smart design.
You can implement somthing like:
Suppose thread #2 is waiting for thread #1 to finish the job, and you want thread #2 to do somting while its waiting for thread #1.
In thread #2 implementation you can do the following:
while (true) // this is the wait loop for the thread #2
{
//check if thread #1 has completed its job
if (yes)
exit from this wait loop.
else
perform the task you want thread #2 to do, while waiting.
//Sleep for say 0 so that others thread gets quantum
}
Manoj
Never Gives up
|
|
|
|
|
thanx manoj
hello every one
|
|
|
|
|
Hi,
To get this implemented you need to have a smart design.
You can implement somthing like:
Suppose thread #2 is waiting for thread #1 to finish the job, and you want thread #2 to do somting while its waiting for thread #1.
In thread #2 implementation you can do the following:
while (true) // this is the wait loop for the thread #2
{
//check if thread #1 has completed its job
if (yes)
exit from this wait loop.
else
perform the task you want thread #2 to do, while waiting.
//Sleep for say 0 so that others thread gets quantum
}
Manoj
Never Gives up
|
|
|
|
|
Manoj Kumar Rai wrote: while (true)
This is smart ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: This is smart ?
It takes smartness to find smart
Manoj
Never Gives up
|
|
|
|
|
Look at ManualResetEvent in System.Threading .
|
|
|
|
|
I need to print some data onto a standard form.
I tried different methods.
But all of them need to set the margins for different printers by trial & error.
Else the data will not fall into the space allocated for it.
I have seen applications that dont have this restrictions.
Can anybode please help me on this ?
Thanks in advance for your help...
|
|
|
|
|
hi ,
can anybody tell how to store the controls on the post back i am using grid view in c#.net
|
|
|
|
|
First of all, you should ask in the ASP.NET forum, as you're using ASP.NET here. Secondly, store them where ? Typically, you need to recreate dynamically created controls in LoadViewState, so they are there before the Load event fires. But, you can't store them anywhere, if you stored something in viewstate to tell you what they were, by the time your viewstate loaded, it would be too late to recreate them so that their viewstate is restored.
Although I believe in 2.0 the state is restored twice, so it may be possible, if you time it right.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
we are developing a web system using dotnet c# . we are having classes as controller class , Model class and the data class . How would i design the modules in a way such that a module can be independantly developed and build for the release . Right now all our modules are interrellated and the dll files are built according to the layers . Is there a way where in build can be done module wise (Each function) and released as and how the development progresses .
if anyone with a good and fast solution ,please help
Thanks
|
|
|
|
|
|
Hi all,
I'm currently working on an internationalization project and one of the things that we have decided to do was to store all string literals that are used in the code in the project string resources (accessible via Properties.Resources.strName; I'm using VS2005).
Here's the problem: say I have a string(Properties.Resources.strName) defined as follows:
Name:\t\t{0}
And it is used as follows:
theString = String.Format(Properties.Resources.strName, "Rachel");
Unfortunately, theString turns out to be
Name:\t\tRachel
which is not quite what I'm looking for.
I could possibly change to string to something like
Name:{0}{0}{1}
and then use it like this:
theString = String.Format(Properties.Resources.strName, '\t', "Rachel")
But surely there is a way to include escape sequence characters like \t or \n in the project resources string table? Does anyone know what the equivalent for these are?
cheers!
|
|
|
|
|
Have you tried just pushing tab instead of typing \t when you enter the string ? Or does that move the focus ? What if you do it to the code, instead of in the editor ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Yes I have tried pushing tab in the editor but it just moves the focus to the next field. I did try editing the resx file manually (I thought I had found the solution to this problem!) but - rather inexplicably - the space created by a manual tab keypress is not the same as what is generated by a \t.
|
|
|
|
|
I had a similar problem when using strings from a text box. See my issue here witha sample program that shows the issue and how I solved it. There was also a good suggestion by another user there.
Hogan
|
|
|
|
|
Thanks for your reply!
For my purposes your solution does seem a little OTT as all I really want to do is to insert escape sequence codes into my centrally located string literals (it seems a little inefficient for me to be checking for and replacing escape sequences everytime I retrieve a string literal from the string bank). I was thinking more along the lines of some Resource setting which I have to tweak to be able to achieve this. Surprisingly (to me anyways), the "{0}" has been successfully identified as being a placeholder for the String.Format parameter but the standard escape sequence codes are not recognised.
I find the @ notation quite interesting as I've never encountered it (but then again, I've only be working with C# for a couple of months). I don't suppose there's a 'reverse-@' notation? Or better yet, something to stop the Properties.Resources from defaulting all '\' to '@\' (as seems to be the case).
cheers!
|
|
|
|
|
Sorry that you didn't find my post that helpful. I came across the same problem and I couldn't find any other solution. While the code I posted is OTT, I was trying to demonstrate a quick fix to the issue. For your case, it could make sense to create a method that you could reference that would do this, so you only have to write it one time. If your string bank in in a class, you could possibly override the accessor to get your value from the string bank so that it did this "automatically".
Hogan
|
|
|
|
|
Hey, thanks for your input!
|
|
|
|
|
In the end, I decided to type the text out in notepad with the relevant newlines/tabs in place and then paste the string in the string resource database. Not very pretty but works fine
|
|
|
|
|
Hello friends,
In my program I need to create a report with Crystal Reports at runtime. The user may select any dataset column to view in the report so a Crystal Reports template which already has fields do not work for me.
I searched through the net but found nothing about creating a report file from ground.
Hence, I need to create a report file on the fly, add fields to it (depending on users' choice) and fill these fields with data.
I will appreciate any help, code, advice, link etc.
Best regards.
.:: Something is Wrong ::.
|
|
|
|
|
hi
i just deploy my program with clickOnce but i cant figure how i can decide where the program gonna be installed
it seem to install it where he wants and i dont find where i can change the destination in my project
if someone can help me
thanks
|
|
|
|
|
RIPOUX wrote: just deploy my program with clickOnce but i cant figure how i can decide where the program gonna be installed
AFAIK, you can't. ClickOnce distributes all applications in their own folders to a common root that you can't change.
If this is an option you want, you have to go with the traditional setup project, which isn't an option with the Express Editions of Visual Studio. You'd need an external tool to do this.
|
|
|
|
|
thanks for the answer though
|
|
|
|
|
www.advancedinstaller.com[^] is, I think, the link for Advanced Installer. Their free version is probably all you need.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have a form called frmsettings where the user can make changes to settings in my application. The form has a close button and I can intercept the this.close() method there to make sure they have saved their changes but I do not know how to catch the closing of the form via the X in the upper right hand corner of the form. Pretty much I want to catch the form closing from any method and check to see if they have saved their settings, if not I would like to give them the option to cancel the close. Much thanks
|
|
|
|