The information in this article applies to:
SUMMARY
When writing an ATL-based COM server, you may end up with a pointer to a specific interface implemented in the server; however, you may want to access the C++ class from the server that implements that interface. MORE INFORMATION
One of the easiest and safest methods to accomplish this "mapping" is to use ATL's COM map and QueryInterface. By placing a pointer to the C++ class into the COM map, you can safely get the pointer to the object by calling the QueryInterface method.
At this point you can get a pointer to that class by calling QueryInterface() and accessing public members of it:
NOTE: It is not possible to access the C++ class from outside the server that it is being implemented inside without exporting the class methods. This method is not advised for COM servers because it breaks the COM model, because the application would need to be written to use that particular server. This method will fail if the pointer to the object needs to be marshaled.© Microsoft Corporation 1999, All Rights Reserved. Additional query words:
Keywords : kbATL210 kbCOMt kbVC500 kbVC600 kbATL300 kbDSupport kbGrpMFCATL kbArchitecture |
Last Reviewed: July 22, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |