Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » broken pick semantics
broken pick semantics [message #37817] Wed, 14 November 2012 23:23 Go to previous message
crydev is currently offline  crydev
Messages: 151
Registered: October 2012
Location: Netherlands
Experienced Member
I'm building a movie managing program. I have a settings dialog that loads data from a global variable which is an instance of a class that manages an XML file. As long as I keep the loading of data inside the constructor of the dialog: there is no problem. When I create a new function that loads the data, for example, to reload the data every time I reopen the dialog I get a "broken pick semantics" error. My code is as following:

ConfigurationStorage MovieManagerConfiguration; // global variable that holds the settings data

void SettingsDialog::Reload()
{
	mDirectoryList.Clear();
	auto x = MovieManagerConfiguration.SyncDirectories.GetCount(); // this throws the semantics error!
	for (int i = 0; i < x; i++)
	{
		mDirectoryList.Add(MovieManagerConfiguration.SyncDirectories[i]);
	}
}


The Vector<String> SyncDirectories contains 1 string variable at that moment. If I put the loop code back inside the dialog constructor the error does not appear. I call the dialog as following:

Inside the constructor of my main window:

mSettingsDialog.WhenSettingsChanged = THISBACK(SettingsChanged);

Inside the open button:

void MovieManager::Options()
{
	mSettingsDialog.Reload();
	mSettingsDialog.Execute();
}


Why am I getting this error? How can I fix it? Am I maybe doing my settings management the wrong way by using a global class instance like this? I am busy on C++ while always have been doing C# so I will believe it if I am not doing the correct thing here.
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Thread with parametarized callback?
Next Topic: dropdown submenu into ToolBar
Goto Forum:
  


Current Time: Wed May 08 22:53:12 CEST 2024

Total time taken to generate the page: 0.02286 seconds