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 » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Porting a Delphi Application
Re: Porting a Delphi Application [message #11690 is a reply to message #11656] Fri, 21 September 2007 20:12 Go to previous messageGo to previous message
cbpporter is currently offline  cbpporter
Messages: 1427
Registered: September 2007
Ultimate Contributor
Well compiling Cairo under U++ sure is hell, I couldn’t get any significant progress so I decided to use the precompiled Windows dll and try to integrate that into U++ control drawing. But before that I have some problems with accessing TreeControl items.
I am trying to insert an TreeNodes with the key as the tag name of a xml tag and the value as the actual XmlNode. On WhenSel I need to obtain that XmlNode and create an object based on it's content.

But I get a dynamic_cast exception when I try to do this.

void MainWindow::Load(int parent, const XmlNode& p)
{
	int t = xml.Add(parent, CBPImages::Move(), p.GetTag(), p);
	for (int i = 0; i < p.GetCount(); i++)
		Load(t, p[i]);
}

void MainWindow::Load(const char *filename)
{
	try 
	{
		XmlNode node = ParseXML(LoadFile(filename));
		int t = xml.Add(0, CBPImages::Move(), "Image", node);
		for (int i = 0; i < node.GetCount(); i++)
			Load(t, node[i]);
	}
	catch (XmlError e)
	{
		PromptOK("XMLError");
	}
}

void MainWindow::SelectItem()
{
	const XmlNode& node = ValueTo<XmlNode>(xml.GetValue());
	lbl.SetLabel(node.GetTag());
}

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to write a dll using Ultimate++?
Next Topic: embedded configuration data/values in self for a executable
Goto Forum:
  


Current Time: Fri Jul 18 06:41:28 CEST 2025

Total time taken to generate the page: 0.04229 seconds