CListBox::GetTextLenは、リストボックスの選択されている項目のテキストの長さを取得するメンバ関数・・・。
選択されている項目のテキストを取得したいが、その前にどれくらいの長さかわからないとバッファを作れないのでこれで長さを取得する・・・。
このように配置して、
pListBox1->GetCurSelで取得したインデックスidxをpListBox1->GetTextLenに渡して、取得した長さをlenに格納し、lenを文字列に変換してメッセージボックスで表示・・・。
"あいうえお"の長さは、
5・・・。
"123"の長さは、
3・・・。
"ABC"の長さは、
3・・・。
Sample/CListBox.h at master · bg1bgst333/Sample · GitHub
Sample/CListBox.cpp at master · bg1bgst333/Sample · GitHub
Sample/CListBoxDlg.h at master · bg1bgst333/Sample · GitHub
Sample/CListBoxDlg.cpp at master · bg1bgst333/Sample · GitHub
Sample/resource.h at master · bg1bgst333/Sample · GitHub
Sample/CListBox.rc at master · bg1bgst333/Sample · GitHub
Sample/stdafx.h at master · bg1bgst333/Sample · GitHub
Sample/stdafx.cpp at master · bg1bgst333/Sample · GitHub