WMI モジュールから非同期的にデータを受け取る C++ 用のモジュールがあります。しかし、彼に数回続けて尋ねると、このエラーが発生し、最初の呼び出しでのみ回答が得られます。どうすればこれを修正できますか?
Security must be initialized prior to the transmission or reception parameters.
Changes can not be made after the initialization.
Just run into this problem today. This error message means CoInitializeSecurity has already been called (it should be called only once per process).
I fix it by adding a flag indicating whether CoInitializeSecurity has been called or not, this flag is set when CoInitializeSecurity is called the first time, by checking the flag the subsequent calls can be avoided.
Considering multithreading you may need to add an exclusive lock to this code block.