|
|
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 |
cbpporter
Messages: 1406 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());
}
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 07:38:10 CEST 2024
Total time taken to generate the page: 0.03487 seconds
|
|
|