CoInitialize 起了什么作用啊?
CoInitialize 与
CoUninitialize 的问题:
Before you create any objects, COM must be initialized by calling the CoInitialize function. If you are creating objects indirectly, the object creation method will handle this task. If you need to create an object with CoCreateInstance, you must call CoInitialize explicitly. When you are finished, COM must be uninitialized by calling CoUninitialize. If you make a call to CoInitialize you must match it with a call to CoUninitialize. Typically, applications that need to explicitly initialize COM do so in their startup routine, and they uninitialize COM in their cleanup routine.
我现在用了CoCreateInstanc,怎么不用这两个函数也可以呢?
还有,我记得我以前确实必须要用这两个函数才能运行我的程序,
但现在(过了半年了),很奇怪,注释掉这俩个函数也一样能运行
我自己都搞不懂为什么。