In fact I want Teststand3 to reconize a functions prototype( function exported from a VC++ .net dll). With TestStand2 and VC++6 I was building a type library for this. I want to do the same thing in VC++ .net, but I have some problems writing the .odl file, because of the CNiString parameter. How should the .odl entry for this parameter look like?
Or, Is there another way, to make teststand3 recognize the functions prototype?
As I mentioned above, the best way I know of to export function prototypes from a Visual C++ DLL is using this syntax (both in the header file and the C++ source code file):
There's nothing else you have to do at this point to get the function to be exported with your DLL. The syntax I listed in my first posting is exactly the syntax you will need to use for your function prototype.
Because of how easy it is to do the export this way, I have never needed to use a .ODL file with Visual C++ 6 or Visual C++ .NET.
Using __declspec(dllexport) is sufficient (and necessary). Visual Studio encodes the parameters and return value information in the decorated name of the function in the DLL. As long as you use types recognized by TestStand 3.0 (such as CNiString), TestStand can decode the parameter information directly from the DLL and does not need a type library. In fact, you cannot use a type library with the Measurement Studio types such as CNiString.
See the online help topic entitled "Exporting Class Methods and Functions in Visual Studio .NET"
Here is a MS kb that describes how to create a type library for the dll. But you probably should not use CNiString as a parameter to be described in an odl file, since its not a COM data type. You might want to use a LPCTSTR instead and use the CniString internally.
To krs - In summary, TestStand can discover the parameter information from a DLL created by VC++, including functions with a CNiString type parameter. TestStand cannot see the parameter information in a function if the project uses a .DEF file or if the function uses the extern "C" syntax.
The TestStand online help topic entitled "Exporting Class Methods and Functions in Visual Studio .NET" discusses the above VC limitations.
If you choose to use a .DEF file or the extern "C" syntax in your VC++ DLL, then TestStand can only discover the prototype of a function if you add the function to a type library in the DLL.