![]() |
|
|
|||||||
![]() |
Wireless Networking - getting the name of the wifi-card for wzcqueryinterface and wzcsetinterface |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hi,
Thanks for all the help so far but I still have some troubles. I try /* snip*/ while (pAdapterInfo != NULL) { if(pAdapterInfo->Type==IF_TYPE_ETHERNET_CSMACD){ //gives me the correct card // Print the Ip Addresses //PIP_ADDR_STRING pAddressList = &(pAdapterInfo->IpAddressList); DoWzCInfo(pAdapterInfo->AdapterName); pAdapterInfo = pAdapterInfo->Next; } // while(pAdapterInfo!=NULL){ /*snip*/ bool CSwitchmodeDlg: int errorc=0; INTF_ENTRY pIntf; TCHAR name[MAXPATH]; DWORD pdwOutFlags; mbstowcs(name,dev_name,strlen(dev_name)); name[strlen(dev_name)]=0; memset(&pIntf, 0x00, sizeof(INTF_ENTRY)); pIntf.wszGuid = name;; errorc=WZCQueryInterface(NULL,//name, INTF_ALL, &pIntf, //when name pIntf.wsGiud empty &pdwOutFlags); if(errorc==ERROR_SUCCESS){ AfxMessageBox(_T("SUCCESS")); return true; }else{ AfxMessageBox(_T("Failed")); return false; } } But get errorc with the value of 2. DWORD dwStatus = WZCEnumInterfaces(NULL, &IntfsTable); if(dwStatus != ERROR_SUCCESS) { error_msg.Format(_T("WZCEnumInterfaces() error 0x%08X\n"), dwStatus); AfxMessageBox(error_msg); return false; } Also returns 2. I'm compiling for a PPC2003 using evc4. Regards Laery PS: I'm using google post and it has some problems lately with repling to posts. Laery |
|
|
|
|
#2 |
|
Posts: n/a
|
When I make a call of this form:
memset(pWLanInfo,0,sizeof(WLAN_INFO)); pWLanInfo->IntfEntry.wszGuid = szAdapterName; // Query zero config info if ((dwError = WZCQueryInterface( NULL, INTF_ALL, &pWLanInfo->IntfEntry, &pWLanInfo->dwOIDFlags)) != ERROR_SUCCESS) { It works fine for me. The adapter name is of the form "CISCO1", etc. Paul T. "Laery" <> wrote in message news: m... > Hi, > > Thanks for all the help so far but I still have some troubles. > > I try > /* snip*/ > while (pAdapterInfo != NULL) { > if(pAdapterInfo->Type==IF_TYPE_ETHERNET_CSMACD){ > //gives me the correct card > // Print the Ip Addresses > //PIP_ADDR_STRING pAddressList = &(pAdapterInfo->IpAddressList); > DoWzCInfo(pAdapterInfo->AdapterName); > pAdapterInfo = pAdapterInfo->Next; > } // while(pAdapterInfo!=NULL){ > /*snip*/ > bool CSwitchmodeDlg: > int errorc=0; > INTF_ENTRY pIntf; > TCHAR name[MAXPATH]; > DWORD pdwOutFlags; > mbstowcs(name,dev_name,strlen(dev_name)); > name[strlen(dev_name)]=0; > > memset(&pIntf, 0x00, sizeof(INTF_ENTRY)); > pIntf.wszGuid = name;; > > errorc=WZCQueryInterface(NULL,//name, > INTF_ALL, > &pIntf, //when name pIntf.wsGiud empty > &pdwOutFlags); > if(errorc==ERROR_SUCCESS){ > AfxMessageBox(_T("SUCCESS")); > return true; > }else{ > AfxMessageBox(_T("Failed")); > return false; > } > } > But get errorc with the value of 2. > > > DWORD dwStatus = WZCEnumInterfaces(NULL, &IntfsTable); > > if(dwStatus != ERROR_SUCCESS) > { > error_msg.Format(_T("WZCEnumInterfaces() error 0x%08X\n"), dwStatus); > AfxMessageBox(error_msg); > return false; > } > Also returns 2. > > I'm compiling for a PPC2003 using evc4. > > Regards > Laery > > PS: I'm using google post and it has some problems lately with repling to > posts. Paul G. Tobey [eMVP] |
|
![]() |
| Thread Tools | Search this Thread |
|
|