试图创建一个数组。 [英] Trying to create an array.
问题描述
我正在尝试在对话框上创建动态列表。
我必须使用RECT,我必须定义:
TCHAR popSz [32];
RECT popRect = {60,18,100,30};
wsprintf(popSz,"%d",players [currentPlayer] ] - > getPopSpace(gNum));
DrawText(hdc,popSz,-1,& popRect,DT_SINGLELINE | DT_RIGHT | DT_VCENTER);
我写了一个steuct,以便我可以拥有一系列TCHARS和RECTS:
struct dyn {
TCHAR size [32];
RECT rect;
};
我尝试过矢量和数组。我在结构中输入RECT
值时遇到问题。原因是我不知道我将会有多少物品,并且我想使用一个简单的循环和数组来显示
的信息。此外,当我显示我想要的项目时:
dyn dList [x] .recy {60 +(x + 15),18,100 +(x +15) ,30};或者我有什么
来把每一行放到他们需要的地方。
谢谢。
I am trying to create a dynamic list on dialog box.
I have to use RECT with I have to define:
TCHAR popSz[32];
RECT popRect = {60,18,100,30};
wsprintf(popSz, "%d", players[currentPlayer]->getPopSpace(gNum));
DrawText(hdc,popSz,-1,&popRect, DT_SINGLELINE | DT_RIGHT | DT_VCENTER);
I wrote a steuct to so that I can have an array of TCHARS and RECTS:
struct dyn{
TCHAR size[32];
RECT rect;
};
I have tried vectors and arrays. I am having trouble putting the RECT
values in the struct. The reason is that I don''t know how many items I
will have in the and I want to use a simple loop and array to display
the information. Also as I display the items I want to be able to:
dyn dList[x].recy{60 + (x+15), 18, 100 + (x +15), 30}; or what I have
to do to put each line where they need to be.
Thanks.
推荐答案
Vitor写道:
Vitor wrote:
我正在尝试在对话框上创建动态列表。
我必须使用RECT,我必须定义:
I am trying to create a dynamic list on dialog box.
I have to use RECT with I have to define:
这不是标准的C ++。您需要找到一个专门用于平台的新闻组。
Brian
This is not standard C++. You need to find a newsgroup dedicated to
your platform.
Brian
" Vitor" ; < no ** @ yahoo.netwrote in message
news:46 *********************** @ roadrunner.com。 ..
"Vitor" <no**@yahoo.netwrote in message
news:46***********************@roadrunner.com...
>我正在尝试在对话框上创建动态列表。
我必须使用RECT我必须定义:
TCHAR popSz [32];
RECT popRect = {60,18,100,30};
wsprintf(popSz,"%d",players [currentPlayer] - > getPopSpace(gNum));
DrawText(hdc,popSz,-1,& popRect,DT_SINGLELINE | DT_RIGHT | DT_VCENTER);
我写了一个steuct,以便我可以拥有一组TCHARS和RECTS:
struct dyn {
TCHAR大小[32];
RECT rect;
};
我尝试了矢量和数组。我在结构中输入RECT
值时遇到问题。原因是我不知道我将会有多少物品,我想用一个简单的循环和数组来显示
信息。此外,当我显示我想要的项目时:
dyn dList [x] .recy {60 +(x + 15),18,100 +(x +15) ,30};或者我有什么需要将每一行放在他们需要的地方。
>I am trying to create a dynamic list on dialog box.
I have to use RECT with I have to define:
TCHAR popSz[32];
RECT popRect = {60,18,100,30};
wsprintf(popSz, "%d", players[currentPlayer]->getPopSpace(gNum));
DrawText(hdc,popSz,-1,&popRect, DT_SINGLELINE | DT_RIGHT | DT_VCENTER);
I wrote a steuct to so that I can have an array of TCHARS and RECTS:
struct dyn{
TCHAR size[32];
RECT rect;
};
I have tried vectors and arrays. I am having trouble putting the RECT
values in the struct. The reason is that I don''t know how many items I
will have in the and I want to use a simple loop and array to display the
information. Also as I display the items I want to be able to:
dyn dList[x].recy{60 + (x+15), 18, 100 + (x +15), 30}; or what I have to
do to put each line where they need to be.
这是你在找什么?类似于:
dyn MyRect;
MyRect.rect.x1 = 60;
MyRect.rect.x2 = 18;
MyRect.rect.y1 = 100;
MyRect.rect.x2 = 30;
取决于rect的实际变量名称是什么。
Is this what you''re looking for? Something like:
dyn MyRect;
MyRect.rect.x1 = 60;
MyRect.rect.x2 = 18;
MyRect.rect.y1 = 100;
MyRect.rect.x2 = 30;
Depending on what the actual variables names of rect are.
" Jim Langston" < ta ******* @ rocketmail.comwrote in message
news:el ************ @ newsfe03.lga ...
"Jim Langston" <ta*******@rocketmail.comwrote in message
news:el************@newsfe03.lga...
" Vitor" < no ** @ yahoo.netwrote in message
news:46 *********************** @ roadrunner.com。 ..
"Vitor" <no**@yahoo.netwrote in message
news:46***********************@roadrunner.com...
>>我正在尝试在对话框上创建动态列表。
我必须使用RECT定义:
TCHAR popSz [32];
RECT popRect = {60,18,100,30};
wsprintf(popSz,"%d", player [currentPlayer] - > getPopSpace(gNum));
DrawText(hdc,popSz,-1,& popRect,DT_SINGLELINE | DT_RIGHT | DT_VCENTER);
我写了一个stetoct到所以我可以拥有一系列TCHARS和RECTS:
struct dyn {
TCHAR size [32];
RECT rect;
};
我尝试过矢量和数组。我在结构中输入RECT
值时遇到问题。原因是我不知道我将会有多少项目,我想使用一个简单的循环和数组来显示
信息。同样,当我显示我想要的项目时:
dyn dList [x] .recy {60 +(x + 15),18,100 +(x +15),30};或者我需要做什么来把每一行放在他们需要的地方。
>>I am trying to create a dynamic list on dialog box.
I have to use RECT with I have to define:
TCHAR popSz[32];
RECT popRect = {60,18,100,30};
wsprintf(popSz, "%d", players[currentPlayer]->getPopSpace(gNum));
DrawText(hdc,popSz,-1,&popRect, DT_SINGLELINE | DT_RIGHT | DT_VCENTER);
I wrote a steuct to so that I can have an array of TCHARS and RECTS:
struct dyn{
TCHAR size[32];
RECT rect;
};
I have tried vectors and arrays. I am having trouble putting the RECT
values in the struct. The reason is that I don''t know how many items I
will have in the and I want to use a simple loop and array to display the
information. Also as I display the items I want to be able to:
dyn dList[x].recy{60 + (x+15), 18, 100 + (x +15), 30}; or what I have to
do to put each line where they need to be.
这是你在找什么?类似于:
dyn MyRect;
MyRect.rect.x1 = 60;
MyRect.rect.x2 = 18;
MyRect.rect.y1 = 100;
MyRect.rect.x2 = 30;
取决于rect的实际变量名称是什么。
Is this what you''re looking for? Something like:
dyn MyRect;
MyRect.rect.x1 = 60;
MyRect.rect.x2 = 18;
MyRect.rect.y1 = 100;
MyRect.rect.x2 = 30;
Depending on what the actual variables names of rect are.
对我来说很惊讶,但这也有效:
dyn MyDyn = {" ABC",1,2, 3,4};
Surpising to me, but this also works:
dyn MyDyn = { "ABC", 1, 2, 3, 4 };
这篇关于试图创建一个数组。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!