Simple COM calls in VC ++

xiaoxiao2021-03-06  13

1: We should initialize the COM environment :: Coinitialize (null); what is it done, or ask Gates!

2: Introducing the target COM set up #import "c: //abc/yourcom.dll" whether the default Namsapce is using you.

3: When using, we should create an instance, the following work is based on the use of the smart pointer, PSMART.CREATEINSTANCE ("{CLSID}");

4: Release the reference PSMar.Release ();

5: Release the resources of the COM environment :: Couninitialize ();

Here is a problem that you want to pay attention to, the smart pointer is a C packaging object, and he has been overloaded -> operation symbol, because we use this operation symbol, its meaning will be different from our regular use, but Use the method in the interface.

转载请注明原文地址:https://www.9cbs.com/read-47799.html

New Post(0)