CComboBox::GetLBText

CComboBox::GetLBTextは、コンボボックスのリストボックス領域で選択されている項目のテキストを取得するメンバ関数・・・。

CComboBox::GetLBText

GetLBTextLenで長さを取得したので、GetLBTextでテキストを取得する・・・。

pComboBox1->GetLBTextLenでテキストの長さを取得したら、バッファptszTextを生成・・・。
pComboBox1->GetLBTextでテキストを取得し、ptszTextに格納・・・。
AfxMessageBoxでptszTextを表示・・・。

f:id:BG1:20160405170544p:plain

でButton2を押すと、

f:id:BG1:20160405170607p:plain

"あいうえお"が出る・・・。

f:id:BG1:20160405170632p:plain

だと、

f:id:BG1:20160405170644p:plain

"123"で・・・。

f:id:BG1:20160405170714p:plain

だと、

f:id:BG1:20160405170731p:plain

"ABC"となる・・・。

Sample/CComboBox.h at master · bg1bgst333/Sample · GitHub
Sample/CComboBox.cpp at master · bg1bgst333/Sample · GitHub
Sample/CComboBoxDlg.h at master · bg1bgst333/Sample · GitHub
Sample/CComboBoxDlg.cpp at master · bg1bgst333/Sample · GitHub
Sample/resource.h at master · bg1bgst333/Sample · GitHub
Sample/CComboBox.rc at master · bg1bgst333/Sample · GitHub
Sample/stdafx.h at master · bg1bgst333/Sample · GitHub
Sample/stdafx.cpp at master · bg1bgst333/Sample · GitHub