本文介绍了DrawText问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好吗,孩子们!

这是我的问题.

我必须创建一个硬件存储程序,在其中将库存放入链接列表中.然后在客户区域中打印该库存.显然,该程序具有更多的规范.
我的问题是它只打印函数的前四行:

How are you doing kids!

Here is my problem.

I have to create a hardware store program where I put the inventory in a linked list. And then print that inventory in the client area. Obviously the program has more specifications than that.
My problem is that it prints only the first four lines of the function:

void Linked_List::display(CPaintDC *dc)
{
	node* print = new node;
	print = start;

        CString temp;
	int x, y=0;
	do{
	x = 0;
		CRect wow(0,y+=20,100,100);
	dc->DrawText(print->StockN ,wow, DT_SINGLELINE);

	wow.MoveToX(x+=100);
	temp.Format(_T("%d"),print->Qty);
	dc->DrawText (temp,wow, DT_SINGLELINE);


	wow.MoveToX(x+=100);
	dc->DrawText(print->Description ,wow, DT_SINGLELINE);

	wow.MoveToX(x+=100);
	temp.Format(_T("%.2f"),print->Price);
	dc->DrawText( temp,wow, DT_SINGLELINE);
	print = print->next;
	}while(print != NULL);

} 



这是我填充链接列表的方式:



This is the way I populate the linked list:

invent.insert("A100",20,"Hammer",9.95);
invent.insert("A250",25,"Saw",13.95);
invent.insert("B400",50,"Flat-Head Nails",11.99);
invent.insert("C888",50,"Flat-Head Screwdriver",6.59);
invent.insert("A499",75,"Pliers",4.95);
invent.insert("C667",50,"Drill",22.95);
invent.insert("B875",70,"Plumbers's Wrench",11.90);
invent.insert("D547",60,"Ladder 10 foot",70.44);
invent.insert("A910",85,"Flashlight 10 inch",9.99);
invent.insert("B123",90,"Assorted Buss Fuses",4.99);



同样,它只对前四行执行此操作.我很确定问题出在那个函数中.

提前致谢. :rolleyes:



And again it only does it with the first four lines. I''m pretty sure the problem is in that function.

Thanks in advance. :rolleyes:

推荐答案


这篇关于DrawText问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 16:57