Click here to Skip to main content
16,017,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have a problem of disable method in win32_networkadapter
Here's my code:
hre = pSvc->GetObjectW(TEXT("Win32_NetworkAdapter"),
		0, NULL, &pClass, NULL);
      ....................
      hre = pClass->GetMethod(TEXT("Disable"), 0, &pMethod, NULL);
      ......................
      hre = pMethod->SpawnInstance(0, &pInInst);


the GetMethod returns successful, but the pointer pMethod is NULL, so the program crashed when calling spawninstance

I'm using vs2005 on win7

Did someone know what's wrong?

thanks!

and sorry for my English!
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