Click here to Skip to main content
15,889,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Mouseover Pin
Mark Salsbery12-May-07 6:14
Mark Salsbery12-May-07 6:14 
QuestionCListCrtl like in task manager Pin
Cedric Moonen12-May-07 2:25
Cedric Moonen12-May-07 2:25 
AnswerRe: CListCrtl like in task manager Pin
Hans Dietrich12-May-07 2:53
mentorHans Dietrich12-May-07 2:53 
GeneralRe: CListCrtl like in task manager Pin
Cedric Moonen12-May-07 2:58
Cedric Moonen12-May-07 2:58 
QuestionCallBack function Pin
Kiran Pinjala12-May-07 1:09
Kiran Pinjala12-May-07 1:09 
AnswerRe: CallBack function Pin
CPallini12-May-07 2:19
mveCPallini12-May-07 2:19 
AnswerRe: CallBack function Pin
Hamid_RT12-May-07 6:05
Hamid_RT12-May-07 6:05 
Questionsave results in xml Pin
lavy288312-May-07 0:31
lavy288312-May-07 0:31 
Hello....I have this function(printinstance()) who generate me randomly boxes(whith another function) with width,height and depth, and I want to save the results in XML, but it only save me just the last box generated...can you figure out what it is the problem in my code please...I have to do this very quick and I am a beginer in XML.

where f-is the first box generated and l-is the last box generated
void printinstance(item *f, item *l, itype W, itype H, itype D)
{ int p,Wcont,Hcont,Dcont;
int const max=1000;
item *i,*j;
itype x1, y1, z1,x2, y2, z2;
stype vol, totvol;
int notip,po;

Wcont=(int)(W);
Hcont=(int)(H);
Dcont=(int)(D);

for (i=f;i<=l;i++)
{
notip=1;
x1 = i->dx; y1 = i->dy; z1 = i->dz;
for (j=i+1;j<=l;j++)
{
if ((i->dx==j->dx)&&(i->dy==j->dy)&&(i->dz==j->dz)) notip++;
}
p=1;
for (j=f;j<i;j++)
if="" ((j-="">dx==i->dx)&&(j->dy==i->dy)&&(j->dz==i->dz))
{
p=0;
break;
}
if (p)
{
x1=i->dx;
y1=i->dy;
z1=i->dz;
XmlTextWriter^ writer = gcnew XmlTextWriter("d:\\contload.xml",Encoding::UTF8);
writer->Formatting = Formatting::Indented;
writer->Indentation=4;
writer->WriteStartDocument();
writer->WriteStartElement("ContainerSolution");

writer->WriteStartElement("ContainerDimensions");
writer->WriteAttributeString("ContainerWidth",W.ToString());
writer->WriteAttributeString("ContainerHeight",H.ToString());
writer->WriteAttributeString("ContainerDepth",D.ToString());
writer->WriteStartElement("Boxes");
writer->WriteAttributeString("BoxWidth",x1.ToString());
writer->WriteAttributeString("BoxHeight",y1.ToString());
writer->WriteAttributeString("BoxDepth",z1.ToString());
writer->WriteEndElement();
writer->WriteEndElement();
writer->WriteEndElement();
writer->WriteEndDocument();

writer->Close();
}}}

and I call my function in the main program like this printinstance(f, l, W, H, D);

lavi
AnswerRe: save results in xml Pin
Mark Salsbery12-May-07 5:22
Mark Salsbery12-May-07 5:22 
AnswerRe: save results in xml Pin
Hamid_RT12-May-07 6:07
Hamid_RT12-May-07 6:07 
AnswerRe: save results in xml Pin
S Douglas13-May-07 2:08
professionalS Douglas13-May-07 2:08 
QuestionOpen() function not opening file Pin
neha.agarwal2711-May-07 23:50
neha.agarwal2711-May-07 23:50 
AnswerRe: Open() function not opening file Pin
Rajesh R Subramanian12-May-07 0:15
professionalRajesh R Subramanian12-May-07 0:15 
GeneralRe: Open() function not opening file Pin
neha.agarwal2712-May-07 0:23
neha.agarwal2712-May-07 0:23 
GeneralRe: Open() function not opening file Pin
Rajesh R Subramanian12-May-07 0:34
professionalRajesh R Subramanian12-May-07 0:34 
QuestionQueue Pin
tamer hasasn11-May-07 23:47
tamer hasasn11-May-07 23:47 
AnswerRe: Queue Pin
Christian Graus12-May-07 0:07
protectorChristian Graus12-May-07 0:07 
AnswerRe: Queue Pin
Stephen Hewitt13-May-07 15:13
Stephen Hewitt13-May-07 15:13 
QuestionHow to add a file list box in SHBrowseOfFolder() dialog? Pin
zhongwenjia11-May-07 23:28
zhongwenjia11-May-07 23:28 
AnswerRe: How to add a file list box in SHBrowseOfFolder() dialog? Pin
Mark Salsbery12-May-07 5:35
Mark Salsbery12-May-07 5:35 
QuestionIP address control Pin
prathuraj11-May-07 20:39
prathuraj11-May-07 20:39 
AnswerRe: IP address control Pin
TariqZ11-May-07 21:20
TariqZ11-May-07 21:20 
GeneralRe: IP address control Pin
Member 1308982521-Apr-17 0:21
Member 1308982521-Apr-17 0:21 
QuestionLow-level(byte-level) Duplicating Pin
Fouad_kayali11-May-07 20:09
Fouad_kayali11-May-07 20:09 
AnswerRe: Low-level(byte-level) Duplicating Pin
TariqZ11-May-07 21:24
TariqZ11-May-07 21:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.