-
Notifications
You must be signed in to change notification settings - Fork 9
/
DeviceList.cpp
63 lines (48 loc) · 1.29 KB
/
DeviceList.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "stdafx.h"
#include "CDM.h"
#include "DeviceList.h"
// CDeviceList
IMPLEMENT_DYNAMIC(CDeviceList, CComboBox)
CDeviceList::CDeviceList()
{
m_Aspi = nullptr;
}
CDeviceList::~CDeviceList()
{
}
BEGIN_MESSAGE_MAP(CDeviceList, CComboBox)
// ON_CONTROL_REFLECT(CBN_SELCHANGE, OnCbnSelchange)
END_MESSAGE_MAP()
void CDeviceList::Initialize(CAspi* Aspi)
{
while (GetCount()) { this->DeleteString(0); }
m_Aspi = Aspi;
int i, cur;
cur = m_Aspi->GetCurrentDevice();
for (i = 0; i < m_Aspi->GetDeviceCount(); i++)
{
CString Vendor, Product, Revision, Address, cs;
m_Aspi->SetDevice(i);
m_Aspi->GetDeviceString(Vendor, Product, Revision, Address);
cs.Format("(%s) %s %s %s", Address, Vendor, Product, Revision);
InsertString(i, cs);
}
m_Aspi->SetDevice(cur);
SetCurSel(0);
}
void CDeviceList::InitializeShortVer(CAspi* Aspi)
{
m_Aspi = Aspi;
int i, cur;
cur = m_Aspi->GetCurrentDevice();
for (i = 0; i < m_Aspi->GetDeviceCount(); i++)
{
CString Vendor, Product, Revision, Address, cs;
m_Aspi->SetDevice(i);
m_Aspi->GetDeviceString(Vendor, Product, Revision, Address);
cs.Format("%s", Product);
InsertString(i, cs);
}
m_Aspi->SetDevice(cur);
SetCurSel(0);
}