This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
Restrictions
Type Library Requirements
The techniques for using COM class described in this document require that the class be described in NGWS runtime metadata. This metadata can be generated in a variety of ways the simplest of which is by converting an existing COM type library. Most COM objects already have a type library either in the form of a separate .TLB file or embedded within the .DLL or .EXE file that contains the object. If type library is not available, one can be created from an existing .IDL file using the MIDL compiler that is part of the Win32 SDK If neither form of type information exists then you have 3 options:
- Create a type library from scratch for the object using IDL and the MIDL compiler.
- Restrict your use of the object to late bound access only. This requires that the COM object support late bound access by exposing an IDispatch interface.
- Use the alternative approach described in the COM Interop Custom Marshaling specification for accessing the COM object.
Other Restrictions
There are other situations in which custom marshaling may be required. These include:
- Interfaces with methods that use type unsafe parameters such as void * or unions
- Interfaces with methods that return success codes
- Interfaces with methods that pass buffers of data where one parameter contains the buffer and another parameter specifies the size of the buffer.
- If a type library contains an interface that use one of the restricted techniques described above, other interfaces described within the type library are still usable.