Go Back   Velocity Reviews > Newsgroups > Wireless Networking
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Wireless Networking - getting the name of the wifi-card for wzcqueryinterface and wzcsetinterface

 
Thread Tools Search this Thread
Old 01-21-2005, 10:57 AM   #1
Default getting the name of the wifi-card for wzcqueryinterface and wzcsetinterface


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:oWzCInfo(char *dev_name){
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
  Reply With Quote
Old 01-24-2005, 06:38 PM   #2
Paul G. Tobey [eMVP]
 
Posts: n/a
Default Re: getting the name of the wifi-card for wzcqueryinterface and wzcsetinterface
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:oWzCInfo(char *dev_name){
> 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]
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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