Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I want to set some config for group policy, using code found on the internet.
::CoInitialize(NULL);
IGroupPolicyObject* pObj = NULL;
hr = CoCreateInstance(CLSID_GroupPolicyObject, NULL, CLSCTX_INPROC_SERVER, IID_IGroupPolicyObject, (LPVOID *)&pObj);
if (FAILED(hr))
// hr = print
break;
As I run this in my win10 it works.But when I use the same code in win7, CoCreateInstance returns 0x800736B1 and IGroupPolicyObject instantiation failed.
I thought gpedit.dll version is too old, but I run in server2008 it works.
And I follow the errcode using sxstrace.exe, the log shows:
INFO: Parsing Manifest File C:\Windows\System32\GPEdit.dll. INFO:
Manifest Definition Identity is (null). ERROR: Activation Context
generation failed. End Activation Context Generation.
Not useful for me.
Maybe some services is not running? I don't know.
Any thoughts much thanks
–
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.