|
Dave Kreskowiak wrote:
And, yes, you can kill the process at any time, but I don't recommend doing this. You run a much greater risk of destabilizing the system (more than it already is! )
Now, I know what you mean and it is generally possible but I don't recall that I ever destabilized Windows (NT 4 and higher) by killing a process except for some cases where I was debugging some applications that used sub-classing (but in this case it was rather a bad API call than the process killing that destabilized the system).
Best regards
Dennis
|
|
|
|
|
If the process doesn't close nicely and it has unmanaged resources open, like most apps do anyway, those resources will suddenly find themselves orphaned. Kill enough apps like this and you'll evently run the system out of resources. Most of the time, if you do an End Process in Task Manager, the process will respond to the normal application shutdown messages. But if it doesn't, the process is then killed off using, shall we say, less than friendly methods.
Also, if the new process he launches launches other processes itself, those become orphaned.
It's just not a good programming practice...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
If the process doesn't close nicely and it has unmanaged resources open, like most apps do anyway, those resources will suddenly find themselves orphaned. Kill enough apps like this and you'll evently run the system out of resources.
You won't run out of resources in most cases. Any resource used by a process will be freed when a process terminates regardless of the reason for the termination, including the use of TerminateProcess()[^] (see Terminating a Process[^]).
Dave Kreskowiak wrote:
Also, if the new process he launches launches other processes itself, those become orphaned.
This is indeed one of the rare cases in which it would be a problem if the child processes don't exit on their own. However, if you really need to divide a solution in multiple processes the child processes should be able to handle the situation (the parent process might simply crash for example).
Dave Kreskowiak wrote:
It's just not a good programming practice.
I generally agree about that and definitely try to avoid it but if you want to automate a third-party tool (which could possibly be buggy), terminating the process might be the only possibility to handle certain situations.
Best regards
Dennis
|
|
|
|
|
Hello All,
please i need to know how can i put a checkbox in column in the datagrid control but with easy steps.in windows control not in webcontrol
please help
hay
|
|
|
|
|
|
Thanks about your reply but i need it with Windows control not in web control
|
|
|
|
|
When binding e.g. a DataTable to the grid you only need to add a column with boolean type to it. When binding the grid will automatically generate the checkbox style for the grid. If you are organizing the styles yourself you have to use the class DataGridBoolColumn. If your are not familiar with TableStyles and ColumnStyles you should read about them in the MSDN (they are rather well documented - search for DataGridTableStyle and DataGridColumnStyle)).
|
|
|
|
|
On occasion, I have problems restoring a Windows Forms appliction after it has been minimized to the taskbar. Clicking on the application on the taskbar will not restore it but right clicking on it and selecting Restore will. It has occured on multiple applications that I have written and does not happen every time they are minimized. Has anyone else experience this problem or have an idea what is causing it?
|
|
|
|
|
I have the menu similar to the IE Favorites
and want to display Tooltips with the url
when selecting the menuItem
ToolTip class is not capable to do that
Can anybody gimme a hand
Writing on C# in the VS2003
|
|
|
|
|
IE Favorites is not a menu, it's a ListView. In order to get something like that to work, you'll have to handle the MouseMove event of the ListView to keep track of the mouse coordinates on your control, handle the MouseHover event of the ListView and use the tracked coordinates in the ListViews' GetItemAt()[^] method to determine which item your hoverng over, then set the Toolip up with the text you need.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
But look
I've got the menu
where different links shown for each user
like
Bob -> LInk 1
LInk 2
Charlie - > LInk3
Link4
All this is done by the menu
And to provide a simple Tooltips on this menu
I should refactor all the code done, Like conver sub-menus
to list-views and display them in the proper pos
is it the easiest way???
|
|
|
|
|
Hey hey, im new to desktop programming, im a web developer and not right back there in java or levels considerd desktop.
...Anyway, ive made a few apps in c# its quite familiar to me coz of flash but i dont know where to begin to make something i can embed into a html page, i mean active x i dont see any projects for it etc control cud be it but im stil not sure
and how do i deploy it do i need to make a cab or somet??
cheers guys
|
|
|
|
|
No building active X controls in .NET. You should try to make a Web Control Library instead.
You can still use ActiveX controls in an aspx page, but you can't make them in .NET
Torin Blair
'In the immortal words of Socrates - "I drank what?".'
|
|
|
|
|
Does anyone know best practices (i.e. a tried and true method) for this problem? I want to re-attempt an operation which caused on exception, and do so an arbitrary number of times. For example, I want to try connecting to a database multiple times before giving up.
I have a solution (in C#), but I suspect it's not the best way to do it :
RETRY:
try
{
dbAdapter.Fill(dataSetToFill, statementCriteria.TableName);
}
catch (System.Data.Odbc.OdbcException dbe)
{
x++;
if (x>max)
{
throw new DMTException("************** ODBC Error >>>" + x.ToString(), dbe);
}
else
{
goto RETRY;
}
}
This seems to work, but I'm using goto, which is never a good idea.
Any suggestions?
|
|
|
|
|
Why not a simple loop?
bool success;
do
{
try
{
success = true;
}
catch(OleDbException)
{
success = false;
}
}while(!success);
Charlie
if(!curlies){ return; }
|
|
|
|
|
Quimbly wrote:
I'm using goto, which is never a good idea.
A well placed goto is worth 1000 whiles :p In your case I see nothing wrong. In fact using goto's within try/catch/finally and switches makes alot of sense if well placed I for one is not gonna try figure out how to loop thru something complex. Sure you can perhaps 'refactor' the metohd, but that isnt allways the better idea either. If you want some reassurance of got usage, read a bit of Linux kernel code before bed tonite
top secret Download xacc-ide 0.0.3 now! See some screenshots
|
|
|
|
|
One problem that I have with my form is that many of my controls are generated run-time, and thus whenever the form is returned to normal status from minimized status, or another form is moved over my primary host form, it causes the run-time controls to be repainted, which takes up time, and makes the application seem to be slow. It even causes the menu system to look like it has frozen. Is there some approach to keeping the form controls to be retained without re-referencing the images referenced by them each time the user manipulates any other forms over it?
|
|
|
|
|
If these are controls you're painting then you should pay attention to the PaintEventArgs.ClipRectangle that is passed to your OnPaint handler. This defines the invalidated clipping rectangle that must be repainted. If you're repainting your whole control - and every control - unnecessarily than the performance degradation is a result.
Your desktop is a 2D surface and windows are drawn on top of each other. WM_PAINT messages are only sent to visible windows and those windows are responsible for honoring the clipping rectangle. So if a control is partly obstructed it should only repaint what it has to, otherwise you're wasting resources and your application will appear hanged.
Layered windows were introduced in Windows 2000 where windows can maintain their surfaces despite being covered - almost a 3D approach to drawing. This is something you have to implement yourself, however, by P/Invoking SetLayeredWindowAttributes or UpdateLayeredWindow depending on your approach. It's interesting to note that the Form.Opacity property uses layerd windows, which is why it's only supported in Win2K and beyond.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Does anyone know if this can be achieved using C#?
I know that concatenation can be achieved but is overlaying possible?
Any comments, views or opinions would be greatly appreciated!
Regards
Ziggy.
|
|
|
|
|
Of course it can.
The algorithms for mixing two or more signals are the same as with other languages and .wav files are just a bunch of Byte s or Int16 s if you strip the header.
You might want to search the articles, I remember there's at least one dealing with reading a .wav file to memory and once you got that it's more or less adding the (weighted) samples.
mav
|
|
|
|
|
Much obliged for your help!
Ziggy.
|
|
|
|
|
I am developing an application with Winforms (w/ C#).This application will work with MS SQL Server.The thing which made me confused is, my application should be noticed, whenever a update / insert generated in that dataSource.
My friend told me that I could handle this situation , using Sql TimeStamp Column..
I found an article ( http://www.codeproject.com/cs/database/Multi-Tier.asp[^]) which talks about the DBConcurrency
Do you have any other ideas rather than using TimeStamp , or should I solve my problem with these technique ?
If there is anything that you dont understand , please let me know ..
|
|
|
|
|
|
|
Hi,
I have to get the area value of a given building plan image. This is a floor plan image where I need to calculate area of a room in the floor plan or the whole area of the floor plan in square meters. I tried to get the pixel value but didn?t work. I can input a scale which the plan has been drawn but find it difficult to obtain the area.
Is there anyway to do that?
|
|
|
|