Thanks for the replies. All of them helped to shed light on the subject for me. This is for a project being done with Qt. The documentation doesn't mention much about it (I couldn't find it anyway). I do have the source code though. Thanks again.
DanielSheets
Posts
-
When to delete a pointer (C++)... -
When to delete a pointer (C++)...I know that if you allocate an object on the heap using 'new', it needs to be deleted. But what if it's a function that returns a pointer to an object? For example...
SomeClass *someClass = aFunction(); // aFunction returns a pointer to SomeClass.
I'm assuming that inside of aFunction(), there is a 'new Someclass()' in there somewhere. However... When I delete someClass on app exit, the app crashes. If I comment out the delete, it exits ok. But won't there be a memory leak if someClass isn't deleted?
-
Serialize subclass of windows.forms.labelI have a subclass of Windows.Forms.Label that I'd like to serialize to XML without using IXmlSerializable. A windows control (a Label in this case) isn't serializable. Consider the following...
public class SubLabel : Windows.Forms.Label
{
public Text {get; set;}
public int LocationX {get; set;}
public int LocationY {get; set;}public void Save(string path)
{
XmlSerializer xs = new XmlSerializer(typeof(SubLabel));
using (StreamWriter sw = new StreamWriter(path))
{
xs.Serialize(sw, this);
}
}public static SubLabel Load(string path)
{
XmlSerializer xs = new XmlSerializer(typeof(TestClass));
using (StreamReader sr = new StreamReader(path))
{
return (SubLabel)xs.Deserialize(sr);
}
}
...
}All I want to serialize are the public properties above. I'd like to keep it simple by using the Save() and Load() methods above. Of course this fails because of the Label parent class. Is there an easy way to do this?
-
What is this new thing?Someone has a lot of time on their hands. :laugh:
-
What is this new thing?Ahhh... Bingo! It got me.
-
What is this new thing?"We may have mislead you slightly on the article topics. Maybe. Are you sure you want to continue?" Why is this popping up all of the sudden? Is the site creating 'interesting' topics for not-so-interesting articles?
-
What is this..."We may have mislead you slightly on the article topics. Maybe. Are you sure you want to continue?" Why is this popping up all of the sudden? Are you creating 'interesting' topics for not-so-interesting articles?
-
This one's kinda interestingI can understand foreign accent syndrome. But using words that she didn't normally use before? I call bullsh*t.
-
Does relying on an IDE for development make you a bad programmer?+100
-
Happy RagnorokYou won't be disappointed (maybe). If you like that kind of music then look up Nightwish as well. She was their singer for the first several albums.
-
Happy RagnorokLove Tarja!
-
Winter Olympics observationThe woman with a gymnastics background did back flips. I don't recall her name at the moment.
-
I'm in the dog house...Ahhh... Understood. :thumbsup:
-
Maunder...Who's winters are getting colder? It sure isn't ours.
-
I'm in the dog house...Rejected because of a 2mm error on the case that they were shipped in? On further thought... When you say 'case', I'm thinking shipping container. Perhaps I'm wrong?
-
The mistake of the DayAhhh yes... I've been bitten by that before too.
-
Bang, you're dead!He deserved to die because he was texting his daughter? Because he (maybe) threw popcorn? You people are pathetic. Its a good thing that the rest of the world isn't as cold and empty.
-
Canada needs an intervention from the Empire.Geez... Mr. ET, a collapsing universe, 4th dimension... My brain hurts. Some of these people are so pessimistic... I don't know how they sleep at night knowing the the end of humanity (or the universe even) is nearing.
-
Bug with Message Type & Latest Box FilterI wouldn't call that a bug. The 'Latest' boxes are for latest posts in their respective forums. Not recently edited posts.
-
Home Electronics ProjectGood point. You're exactly right. The 24V part slipped my mind. We use 5V LED's so I guess, in my mind, I associated "LED" with "5V". Could set up a bank of switching circuits but that may be a lot of trouble for Christmas lights.