|
本帖最后由 oOoOo圈圈ooOo 于 2015-5-13 00:17 编辑
我的代码如下:
void CreateListItem()
{
HELE hList = XWnd_GetEle(m_hMainWnd, LIST_SAMPLE);
for (int i = 0; i < 3; i++)
{
XList_AddItem(hList, L"0001");
XList_SetItemText(hList, i, 1, L"0002");
XList_SetItemText(hList, i, 2, L"0003");
}
XEle_RedrawEle(hList, TRUE);
HELE hEdit = XEdit_Create(0, 0, 40, 22, hList);
itemBindEle_ itemEle;
itemEle.hEle = hEdit;
itemEle.left = 0;
itemEle.top = 0;
itemEle.width = 40;
itemEle.height = 22;
XList_SetItemBindEle(hList, 0, 1, &itemEle);
itemBindEle_ itemInfo = {0}; // 此处不管是初始化还是不初始化结果都一样获取不到绑定元素
int nBindCount = XList_GetItemBindEleCount(hList, 0, 1); // 此处可以获取到绑定元素个数(为1)
BOOL bRet = XList_GetItemBindEleInfo(hList, 0, 1, &itemInfo, 1); // 最后一个参数我试了-1, 0, 1, 2 都不行,获取不
// 到元素, 并且返回值为FALSE
}
|
|