Regarding getting links to the IDot11AdHocManager COM WiFi AdHoc interface

I am trying to create an AdHoc connection, and for this I am using the AdHoc wifi interface provided by Microsoft. I wrote the 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 the Dot11AdHocManager link, it will return an error and a NULL value, please help me get a link to the Dot11AdHocManager interface, so I can use its method, which will help me create the AdHoc Network

+4
source share
1 answer

It should be (last parameter changed):

 hr = CoCreateInstance(CLSID_Dot11AdHocManager,NULL,CLSCTX_INPROC_SERVER,IID_IDot11AdHocManager ,(void**) &pIAdHocMng); 
0
source

Source: https://habr.com/ru/post/1305926/


All Articles