NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Calling a NGWS Object from a COM Client

Once a NGWS class is registered with COM, COM clients can create instances of that class and request services from the resulting objects just as if they were any other COM object. Further, the NGWS objects receive requests from COM clients just as if they were requests from any other NGWS client.

From the point of view of the client and server code, then, the differences between COM and the NGWS runtime are largely invisible. Microsoft Visual Basic clients can view NGWS objects in the object browser, which exposes the object's methods and their syntax, its properties, and its fields exactly as if they were any other COM object.

For C++ clients, there are some important differences. For example, COM classes are defined using the Microsoft Interface Definition Language (MIDL). The MIDL compiler generates C++ headers, which declares an object's interfaces and methods and makes them available to client programs. The NGWS runtime does not use headers to define types, nor does the RegAsm utility generate them. In order to get header information for a NGWS class, use TblExp.exe on the managed assembly and then import the resulting type library into your C++ program using the C++ #import preprocessor directive. Microsoft Visual C++ automatically generates a .tlh file from the type library.

This section explains the following: