Regarding to get refrence of IDot11AdHocManager Interface of COM WiFi AdHoc manager Interface

Posted by sathaliyawala on Stack Overflow See other posts from Stack Overflow or by sathaliyawala
Published on 2010-04-03T10:32:58Z Indexed on 2010/04/03 10:33 UTC
Read the original article Hit count: 552

Filed under:

I am Trying to create AdHoc connection and for this i am using AdHoc wifi Interface provided by Microsoft. I have written code :-

    IDot11AdHocManager *pIAdHocMng = NULL ;
HRESULT hr = CoInitialize(NULL);

hr = CoCreateInstance(CLSID_Dot11AdHocManager,NULL,CLSCTX_INPROC_HANDLER ,IID_IDot11AdHocManager ,(void**)pIAdHocMng); 
if(hr == S_OK)
        printf("CreateNetwork Method success due to following reason :\n %ld",hr) ;
else 
        printf("CreateNetwork Method fail due to following reason : %ld \n ",hr) ;

getch();

CoUninitialize();

But it will not return reference of Dot11AdHocManager it will return error and NULL value please help me to get the reference of Dot11AdHocManager Interface so i can use it method which help me to create the AdHoc Network

© Stack Overflow or respective owner

Related posts about network-programming