You are in the wrong forum for such questions. You would have better luck visiting another community that focuses on Windows development. This forum is focused on threat modeling using Microsoft's SDL TM tool.
With that said, I would recommend that when you DO put a post up in a more appropriate forum, you also include more information such as what language you are writing in, where exactly you are seeing the error, and the steps to reproduce it. That will significantly help your peers to understand your problem and hopefully help you with a fix. If possible, even show the offending line of code.
As a final comment before you head off to a more appropriate group, your error code of 2147749891 is really 0x80041003, which if you check MSDN shows as ACCESS_DENIED. Depending on the calls you are trying to do, perhaps you do not have the appropriate privileges to accomplish the task you are trying to do? That should atleast you get started in debugging your issue.