LabWindows/CVI

CDotNetInvokeGenericStaticMember

int CDotNetInvokeGenericStaticMember (CDotNetAssemblyHandle assembly, const char *typeName, size_t numberOfGenericTypes, const char * genericTypes[], int invokeMechanism, const char *memberName, size_t numberOfMemberGenericTypes, const char * memberGenericTypes[], size_t numberOfParameters, const char * parameterTypeNames[], unsigned int parameterTypes[], void * parameters[], unsigned int *returnType, void *returnValue, CDotNetHandle *exception);

Purpose

Calls the specified generic static member of the specified .NET object. You can use this function to call methods, get and set properties, and get and set fields.

The signature of the called member must match the arguments you pass to the parameters of this function.

Parameters

Input
Name Type Description
assembly CDotNetAssemblyHandle The handle of the .NET assembly that defines the .NET type whose member you want to call.
Note  If you pass an invalid handle, the .NET execution engine can get corrupted. This can result in an execution engine exception that the library cannot handle, which will cause the system to terminate your program.
typeName const char * The name of the .NET type whose member you want to call.
numberOfGenericTypes size_t The number of generic type parameters to pass to .NET.
genericTypes const char * [] The generic type names to pass to .NET.
invokeMechanism int The mechanism to use to invoke the member. You must use one of the following mechanisms:

  • CDOTNET_CALL_METHOD
  • CDOTNET_GET_PROPERTY
  • CDOTNET_SET_PROPERTY
  • CDOTNET_GET_FIELD
  • CDOTNET_SET_FIELD
memberName const char * The name of the member to call.
numberOfMemberGenericTypes size_t The number of member generic type parameters to pass to .NET.
memberGenericTypes const char * [] The member generic type names to pass to .NET.
numberOfParameters size_t The number of parameters to pass to .NET.
parameterTypeNames const char * [] The type names of the parameters to pass to .NET.
parameterTypes unsigned int [] An array containing the types of the parameters to pass to .NET.
parameters void * [] An array containing the parameters to pass to .NET.

Note  All the parameters must be passed by reference.
Output
Name Type Description
returnType unsigned int The type of the return value of the call to the member. Pass zero if there is no return value.
returnValue void * The return value of the call to the member.

You can pass NULL for this parameter.
exception CDotNetHandle The handle to an exception thrown by .NET.

If .NET throws an exception, you can pass this handle to CDotNetGetExceptionInfo to get information from the exception object.

You can pass NULL for this parameter.

Return Value

Name Type Description
status int A value indicating whether an error occurred. Negative error codes indicate function failure.

Error codes are defined in cvi\include\cvidotnet.h.

You can use CDotNetGetErrorDescription to get the description of an error code.

Additional Information

Library: .NET Library

Include file: cvidotnet.h

LabWindows/CVI compatibility: LabWindows/CVI 8.1 and later