Regarding to get refrence of IDot11AdHocManager Interface of COM WiFi AdHoc manager Interface
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 Dot11Ad开发者_高级运维HocManager Interface so i can use it method which help me to create the AdHoc Network
It needs to be (the last parameter is changed):
hr = CoCreateInstance(CLSID_Dot11AdHocManager,NULL,CLSCTX_INPROC_SERVER,IID_IDot11AdHocManager ,(void**) &pIAdHocMng);
精彩评论