alexsendar 2017-01-26 04:00 采纳率: 100%
浏览 844
已采纳

win32开发 1.我创建了7个listview,下面是代码,为什么没有名字?

2.怎么根据这7个按钮的点击来执行相应得函数?

BOOL CFileOpt::InitListViewColumns(HWND hWndListView)
{
WCHAR szText[256] = L"abc"; // Temporary buffer.
LVCOLUMN lvc;
int iCol;

// Initialize the LVCOLUMN structure.
// The mask specifies that the format, width, text,
// and subitem members of the structure are valid.
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;

// Add the columns.
for (iCol = 0; iCol < 7/*C_COLUMNS*/; iCol++)
{
    lvc.iSubItem = iCol;
    lvc.pszText = (LPSTR)szText;
    lvc.cx = 100;               // Width of column in pixels.

    if ( iCol < 2 )
        lvc.fmt = LVCFMT_LEFT;  // Left-aligned column.
    else
        lvc.fmt = LVCFMT_RIGHT; // Right-aligned column.

    // Load the names of the column headings from the string resources.
    LoadString(m_hInst,
        /*IDS_FIRSTCOLUMN*/NULL + iCol,
        (LPSTR)szText,
        sizeof(szText)/sizeof(szText[0]));

    // Insert the columns into the list view.
    if (ListView_InsertColumn(hWndListView, iCol, &lvc) == -1)
        return FALSE;
}

return TRUE;

}
图片说明

  • 写回答

3条回答 默认 最新

  • alexsendar 2017-02-14 09:36
    关注

    删除loadstring语句,就可以显示名字。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分