|
Hi,
Can you tell me how to add(or remove) column in Crystal Reports at runtime.
Thanks on advance!
|
|
|
|
|
As far as I know you can not do that if you do not use the Crystal Report RAS Server. With that you can produce the all report in runtime.
|
|
|
|
|
I sometimes face thıs problem of Windows XP refuses to shut down when an .NET Application is running. One clear example is an application which has a notify icon on the task bar. Unless I close the aplication first , windows does not shut down.
Anybodeh knows shut down procedure and the cause of this problem?
|
|
|
|
|
How do you databind to checkedlistbox since it does not have DataSource property. I want to bind an array to list the check boxes in that control. Thanks in advance
|
|
|
|
|
You can either implement data-binding yourself using the CurrencyManager from the CheckListBox control's BindingContext . See that property documentation and follow the references to learn more. You won't get it for free, but it's a good place to start. If you use it often, extend CheckedListBox with your own control and add data-binding capabilities.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Is there any way that I can abort a thread that currently lies waiting for a message from a stream.
The code uses a for loop to keep the thread running. When a message comes on the stream, that message is read with StreamReader.ReadLine.
The problem is that the thread lies waiting until a messa comes on the stream. This means that the thread cannot be aborted because it is busy.
Does anyone know of a solution on this problem?
|
|
|
|
|
It sounds like you created a separate thread to handle the input (this thread is calling StreamReader.ReadLine). Are you saying that you can't call System.Threading.Thread.Abort on that thread?
If you haven't created a separate thread to make the calls to ReadLine, you should. ReadLine's a synchronous call, and the StreamReader doesn't really give you any asynchronous options.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
The code works like this: Another thread calls abort on the thread running and calls join on it. After the call to abort the state of the thread to be aborted is AbortRequested. The problem is it never leaves AbortRequested and goes into Stopped. This means the join never happens and the program is locked.
Any ideas?
|
|
|
|
|
I was afraid you were going to say that So you're calling Abort and then Joining on that thread. This shouldn't be a problem.
I've never run into this myself, so I'm not an expert in this area. Take everything I say with a grain of salt since it's just based upon docs and not practical experience with this problem .
If you read the MSDN docs, there are a few cases that can cause Abort not to work. I'm assuming you're not doing something like a ResetAbort in the code of the thread you're trying to abort, which could obviously cancel the abort. If it's someone else's library, I guess you need to check for that.
The big one that sticks out in the docs to me is:
"The thread is not guaranteed to abort immediately, or at all. This situation can occur if a thread does an unbounded amount of computation in the finally blocks that are called as part of the abort procedure, thereby indefinitely delaying the abort. To ensure a thread has aborted, invoke a Join method on the thread after calling Abort."
This means you might have a finally block that for some reason is taking forever to return. If you have a finally catch block, check for this. Put a break point in your finally block and make sure it returns if you have one.
The other quote I notice is this:
"If Abort is called on a thread that has not been started, the thread will abort when Start is called."
That means if you try to abort a thread that's never been started, you'll never be able to Join on it. I'm assuming your thread is actually started though, but make sure.
Other than that, I have no clue. If you're still having a problem, try to create a really small snippet of code and a project that demonstrates this problem. I realize this might be a client and server example in the case of socket code, and creating a simple test app to show this beomes a bit more difficult. Having some code to look at might make things much easier to debug though. One thing about creating a simple project to demonstrate the problem is you sometimes find you can't recreate the problem in the simple one, and then you go from there to figure out the difference between the two.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
|
I've downloaded these and I'll take a look at this later today when I get a chance.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Ok, I've taken a look at what you're doing.
First, the thread Abort thing might be something you can never work around. Read the last post in this thread for instance: When Abort might not work. That shows me that using Abort on a thread dealing with sockets might not ever abort until the underlying socket code allows it to.
That said, you really don't need to Abort to make a proper client and server. Most people create a server that handles multiple clients. They do this by having their server go into accept mode. Once a connection is accepted, they launch a new thread to handle that connection and start accepting new connections again.
As far as disconnecting the threads, you can catch the exception when your sockets are no longer connected (your ReadLine in this case will throw an exception). This would be the point where you would end that processing thread.
I hope that makes sense.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
hi
i m developing a simple application in C# and i want to know that how can we launch the application on the statup of windows like msn messenger do.so that when we boot the windows it start our application. i m using Windows XP.
thanks for your help.
|
|
|
|
|
Do you want it like MSN Messenger (where it launches when someone logs on) or do you want a service that launches when the machine comes up (regardless if someone logs on or not)?
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
i want it to comes up when machine comes up regardless of if someone logs on or not.
thank you
|
|
|
|
|
Then you want to create a Windows Service. The wizard inside VS.Net has a wizard for windows services, and that's a good place to start. You'll basically be creating a class that derives from System.ServiceProcess.ServiceBase. You'll also have to add an installer component (System.Configuration.Install.Installer) for your service and run "installutil" to get your service properly installed.
Services are not that hard to create, but they're a bit of a pain to debug. I recommend you find a good article on them somewhere to get started. A lot of people end up creating a class that they contain first in a normal console application for debugging purposes. They later contain that class in their service when they feel like it's been debugged a good amount.
Hope that helps a bit.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
You can either install a shortcut into the All Users' or a specific user's Start Menu->Programs->Startup folder, or install a registry key into either HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE under the key Software\Microsoft\Windows\CurrentVersion\Run.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
You could also open Regedit.exe.
Go to "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run".
Add a String Value.
Set it's name to whatever you want.
Let it's value point to the pad of the program you want to run. Enter something like: "c:\windows\explorer.exe ??" where ?? are optional commandline-arguments you would want to use.
While this key is originally designed for Win9x it should also work on XP. At least it works on my XP-version.
Of course you could also add such a value by using a .reg file or you could let the installer you use for deploying you application do this for you.
I'm not shure whether or not someone needs to log on first before the application gets started, but it works for all users.
I hope this helps. Roland.
|
|
|
|
|
How can I define a static variable in a method for example like this:
private method()<br />
{<br />
static int c=0;<br />
c++;<br />
}
|
|
|
|
|
You can't; it's not allowed in C#. (Anyone know why?) The workaround is to declare your static variable as a field.
static int c=0;<br />
<br />
private method()<br />
{<br />
c++;<br />
}
Regards,
Alvaro
He who laughs last, thinks slowest.
|
|
|
|
|
|
Hmmm, the strange thing is that it's also not allowed in Java. I wonder if there's a correlation...
jparsons wrote:
it was a dumb idea and easily screwed up
I don't consider it a dumb idea. There are times when it's nice to hold on to a value that only applies to a specific method. The problem may lie in the fact that static variables are initialized only once, so they can cause confusion:
void foo()
{
static int n = 0;
...
}
When you see a method like that in C++, you need to keep in mind that the statement is only executed the first time the method is called. The casual (or careless) observer may not be aware of that, and erroneously think the method executes every time -- I'm pretty sure it's happened to me before .
Regards,
Alvaro
He who laughs last, thinks slowest.
|
|
|
|
|
You can't. Static variables belong to an entire class, not a method. To define a variable inside a static method, just leave out the word 'static'.
I remember programming in LotusScript, an old VB-based language. You could define a static function, and any variable declared in the function would be kept around for the next invocation of the function. C# doesn't work like that.
Regards,
Jeff Varszegi
|
|
|
|
|
you must define the static as a field, now you get Compiler Error CS1525.
Try this:
static int c = 0;
private void method()
{
c++;
}
Regards,
Wernand.
|
|
|
|
|
I'm creating a C# .net program which contains one .exe file and one .dll file.
I need to create an installer for this program to let the user install my program from for example a cd.
What is it I should do? I really have no idea. I know there is an installer class i .net but the documentation is terrible about how one uses it.
Could anyone point out what I need to do?
|
|
|
|