Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to code for AdHoc WiFi connection .For this i am using IDot11AdHocManager interface and to get the refrence for this i am using CoCreateInstance method.To obtain reference for IDot11AdHocManager i have written following code but it will give error or return NULL refrence. Please help me or correct my 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() ;
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900