|
I have a user control (composed of 10 text boxes).
on certain user inputs -> multiple rows of above user control are added to a form.
After certain amount of operation, I start getting error - cannot create window handle.
How do I need to clear window handle? Shouldn't it be automatically disposed?
Gurpreet
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:20am.
|
|
|
|
|
I do not want to show them all at once. At a time say 100 are visible but after the user changes the input I need to show other 100. But how do a ensure that the handle is destroyed for previous ones?
Gurpreet
|
|
|
|
|
So you have 100 visible UserControls with 10 TextBoxes each, and a lot of invisible ones?
That is a bad design. If you need that many user inputs, use a listing control, maybe a DataGridView.
|
|
|
|
|
KaurGurpreet wrote: How do I need to clear window handle?
You don't. That's handled by the controls themselves.
If you're running into this problem, it could be that your Showing a form with ShowDialog (not Show!), but never Disposing it when you're done. Just because you can't see the form anymore doesn't mean it's gone. If you don't Dispose the form, you're leaking resources (handles). This issue does not come up if the form is shown with the Show method.
If you're putting up hundreds and hundreds of controls, your design is the problem, not the window handles being released.
|
|
|
|
|
Hi All,
I want to retrieve all the users of a computer which is in network in my C# application.
Any idea?
Regards,
Sunil G.
|
|
|
|
|
Message Closed
modified 23-Nov-14 6:20am.
|
|
|
|
|
There is no any domain in my company.
|
|
|
|
|
Then you will have to use netapi32.dll
look here: article
|
|
|
|
|
Hi all, How to create xmpp client using C#? Can anybody help me I just need that client to talk(chat) with xmpp server like jabber etc.
|
|
|
|
|
choose a single forum to ask your question, and stick to it.
|
|
|
|
|
Hi,
I have the following RSS Feed containing a CDATA Tag. I wish to get the "img src" attribute information, but i am unable to get it. Can anybody help please !!!.
I am using LINQ to XML. Please give LINQ solutions only...
<description><![CDATA[
><img src="http://l.yimg.com/a/i/us/we/52/30.gif"/><br />
<b>Current Conditions:</b><br />
Partly Cloudy, 37 C<BR />
<BR /><b>Forecast:</b><BR />
Fri - Sunny/Wind. High: 39 Low: 25<br />
Sat - Sunny/Wind. High: 42 Low: 26<br />
<br />
<a href="http://us.rd.yahoo.com/dailynews/rss/weather/Islamabad__PK/*http://weather.yahoo.com/forecast/PKXX0006_c.html">Full Forecast at Yahoo! Weather</a><BR/><BR/>
(provided by <a href="http://www.weather.com" >The Weather Channel</a>)<br/>
]]></description>
Thank you in advance...
|
|
|
|
|
Just access the RSS feed(XML content) in your dataset , after getting in your dataset you can do wat ever you want.
|
|
|
|
|
If you guide me a bit further...
1. I have loaded the document as follows.
XDocument rssFeed = XDocument.Load(sForecastUrl);
2. Now i get the descendant nodes as follows
var desc = from e in rssFeed.Descendants("channel").Descendants("item").Descendants("description")
select e;
foreach (var element in desc)
{
element.Value;
}
I am able to get description element value which contains the cdata tag.
Dont know what to do next to get "Img Src" attribute directly rather than from string manipulation.
Some code in the foreach loop should help please.
|
|
|
|
|
No No...
Get the XML and convert the XML to DATASET using dataset.readxml() you will get all tags as columns and its attributes , so you can easily get the attribute value.
|
|
|
|
|
Oh!!!
I understood your point on using datasets, but i have written all my work using linq to xml. i have successfully parsed whole of the xml document already, only part missing was this cdata tag, so i was asking for finding a solution to that using linq as well. i don't want to load the complete document as dataset again, i have already loaded the webresponse into xDocument. So any solution relating to that...
Even though i can get the url out from the attribute using string manipulation but clearly that is not the right method.
P.s. Thanks for the dataset option though....
|
|
|
|
|
Hai
My USB device is communicating with my C# application once in 500ms and exchanging data(Using a timer and interrupt transfer.) So far seems Ok.
If my device is abruptly removed,(I think)windows 'device removal' message arrives only after removal is complete. But my application tries to write to my device in the meantime and throws an exception . The write is failed - I tried by stopping next transfers but still exception throws with some other message.
I have a try catch statement block.
If a USB 'device write' failed as handle is no longer valid or present how should we tackle the exception and save the application from crashing?
Thanks
With Regards
Roy Thomas
"..this file is known as source file probably because it is a source of frustration and anxiety!" - Chuck Sphar - In book 'C# 2005 for Dummies'.
|
|
|
|
|
pulbic class A
{
public void func1()
{
}
....
}
public class B : A
{
...
}
How to let user not use the func of class B
The keyword new is only hide the old function but new a new method func.
|
|
|
|
|
yes
Hints: virtual, new
I bug
|
|
|
|
|
No. You could make it throw an Exception. But what you are trying to accomplish is a bad design; B probably shouldn't derive from A at all.
|
|
|
|
|
I would say that's not always the case. Sometimes, you may want to create a class that has most of its base class' functionality, but not allow derived classes access to the base class' version of a given method. I've never personally run into a situation like that, but I could see it happening.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
It happens all the time when deriving from System.Windows.Forms.Control for instance. In fact most (if not all) of the controls provided hide some base methods and properties.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
Hide them so they can't be used/accessed?
|
|
|
|
|
MS do it all the time - they mark them as Obselete , throw NotSupportedException s as well as the standard EditorBrowsableState.Never and Browsable(false) etc... I agree - against OOP principles but as they included so much functionality in such classes there is little choice.
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
That violates basic OOP principles.
|
|
|
|