As if I needed yet another reason to hate measurement studio, or for that matter almost all NI products I’ve got another reason. It seems that those COM interfaces that are provided for the DataSocket Server are just a tease. If you’ve got some time to kill try writing a class that implements _INIDSCtlEvents. You’ll quickly learn that It doesn’t like you. The paramter passed to GetTypeInfo count is invalid. Where it should be a pointer to a valid memory address, the datasocket instead prefers to pass a pointer to the address 0×00000001. Let’s just say when you derefrence that you get a mountain of problems.
So, what should have been a quick and dirty class that could be knocked out in 10 minutes turned into several hours of cursing. Ultimately I gave up, and had to write a wrapper in C#. I exposed my classes and interfaces through .Net Interop services and am in business. It is a kludge but damn it, it works!
As an interesting note, if you watch the DLLs that get loaded whenever you run an MFC based application that uses the NI provided class a large number of .Net assemblies get loaded as well.