DotNetCall.LoadPrototypeFromSignature

Syntax

DotNetCall.LoadPrototypeFromSignature( signatureOrMemberName, allowMemberNameMatching, options = 0)

Return Value

Boolean

Purpose

Returns True if the .NET Adapter successfully loaded the prototype for the specified call. This method returns False if the adapter cannot find the signature or member name. This method loads the parameters and prototype information for a .NET member given the signature or name of the member.

Remarks

This method replaces the obsolete DotNetModule.LoadPrototypeFromMetadataToken method.

This method is the primary mechanism for specify DotNetCall member prototypes. TestStand finds the member in the assembly that matches the given signature (or member name if you pass True for the allowMemberNameMatching parameter) and loads the prototype while setting all parameters and member information for the call. Use the suffix - Get or - Set to specify a get or set property or field operation. When you specify a property or field, you can omit the suffix and TestStand attempts to find a match by giving priority to properties with a - Get suffix. This behavior occurs even when you pass False for the allowMemberNameMatching parameter.

Note If you specify a member name instead of a full signature when overloads exist for the member (and you pass True for the allowMemberNameMatching parameter), TestStand loads the prototype of the first overload in sorted order.

Use the following guidelines to specify a signature string:

  • For methods and constructors —Specify the method or class name followed by the data types of the parameters in parentheses, separated by commas. For example: MyClass(Int32, System.String[] ByRef) MyMethod(MyNamespace.MyClass ByRef, Double, Int32[,] ByRef) Use the DotNetAdapter.GetMemberNames method to obtain a list of signatures for a particular assembly and class or to review more examples of the format for signatures.
  • For Use Existing Objects calls —To use an existing object reference, pass Use Existing Object(MyNameSpace.MyClass) , such as Use Existing Object(System.Collections.Queue) . The .NET Adapter treats the class name as a parameter and uses it to specify the TestStand variable that holds the object reference you want to use.
  • For properties and fields —If a property or field does not have an indexer, specify the property or field name followed by the - Get or - Set suffix to specify the type of operation to perform, as in MyProperty - Get or MyField - Set . If a property or field does have an indexer, add a space after the property name and add square brackets with the indexer types specified in a comma-separated list, as in: MyPropertyWithIndexers [Int32, System.String ByRef] - Get .
  • For parameter strings —For basic types other than System.String , such as 32-bit integers and doubles, omit the System. prefix. For arrays, include the square brackets with commas inside to specify the number of dimensions. For ByRef and output parameters, include the string ByRef , including the initial space, after the parameter data type.

Signatures for the First Call in the Collection

You can set the first call in the collection only to a constructor or static member or use an existing object.

Note

Starting with TestStand 2024 Q4, 'Create Remote Object' is no longer supported.

Example Signature Formats for System.String Class Members

  • Simple member name Replace . No overload exists for this method so the adapter requires only a simple name (as long as you pass True for the allowMemberNameMatching parameter).
  • Full signature with parameter types Split(Char[], Int32, System.StringSplitOptions) . Overloads exist for this method, so the adapter requires the full signature to choose a specific overload (even if you pass True for the allowMemberNameMatching parameter). Note that Char and Int32 types do not have the System. prefix before the type name because they are basic types.
  • Property simple member name Length . This property is read-only so the adapter does not require the - Get suffix because Get is the only option.
  • Property Length - Get . If this property has both public read access and public write access, the adapter requires the - Get or - Set suffix to specify the operation to perform. However, if no suffix is provided, the adapter chooses - Get by default.
  • Constructor String(Char[], Int32, Int32) . Multiple constructors exist so the adapter requires a full signature to specify a specific constructor. If only one public constructor exists, you can pass String as the signature (as long as you pass True for the allowMemberNameMatching parameter).

Parameters

signatureOrMemberName As String

[In] Specifies the signature or member name of the member with the prototype you want to load. If you want to pass a member name instead of a full signature, you must also pass True for the allowMemberNameMatching parameter.

allowMemberNameMatching As Boolean

[In] Specifies whether to allow matching simply by member name instead of requiring a match to the full signature. If you pass False for this parameter, the .NET Adapter loads the prototype only if the signatureOrMemberName parameter exactly matches the full signature of a member. If you pass True for this parameter, the adapter first looks for a full signature match to the signatureOrMemberName parameter. If the adapter cannot find a match, it looks for a member name that matches the signatureOrMemberName parameter. To choose a specific overload, you must specify a signature instead of a member name. Refer to the Remarks section of this topic for more information about specifying a signature.

options As Long

[In] Specifies one or more LoadPrototypeOptions constants. Use the bitwise-OR operator to specify multiple flags.

This parameter has a default value of 0 .

See Also

DotNetCall.IsCallValid

DotNetCall.IsPrototypeIncompatible

DotNetCall.SetIncompleteSignature

LoadPrototypeOptions