【发布时间】:2017-03-10 10:06:37
【问题描述】:
我想使用WlanQueryInterface 函数获取wlan_intf_opcode_bss_type。
我的代码:
PDOT11_BSS_TYPE wlanInterfaceState = NULL;
DWORD wlanInterfaceStateSize = sizeof(wlanInterfaceState);
DWORD interfaceStateResult;
interfaceStateResult = WlanQueryInterface(hClient, &pIfInfo->InterfaceGuid, wlan_intf_opcode_bss_type, NULL, &wlanInterfaceStateSize, (PVOID *)&wlanInterfaceState, NULL);
if (interfaceStateResult != ERROR_SUCCESS) {
qDebug() << "Error";
} else {
qDebug() << wlanInterfaceState;
}
我得到十六进制值。当我使用 switch 枚举 wlanInterfaceState 时出现错误:
error: C2450: switch expression of type 'PDOT11_BSS_TYPE' is illegal
更新:
DOT11_BSS_TYPE MSDN 中的枚举语法:
typedef enum _DOT11_BSS_TYPE {
dot11_BSS_type_infrastructure = 1,
dot11_BSS_type_independent = 2,
dot11_BSS_type_any = 3
} DOT11_BSS_TYPE, *PDOT11_BSS_TYPE;
如何在wlanInterfaceState 上使用这些枚举?
谢谢。
【问题讨论】:
-
即使您使用的是 qt,这也不是 Qt 的问题。你应该删除这个标签。
-
我的建议。尝试使用 QTextStream 而不是 QDebug。看看 -> here
-
我使用 qDebug() 只是为了测试目的。我想在 QLabel(setText 函数)中显示实际数据。
标签: c++ windows-applications wlanapi