CDotNetCreateInstance
- Updated2023-02-21
- 2 minute(s) read
int CDotNetCreateInstance (CDotNetAssemblyHandle assembly, const char *name, void *instance, size_t numberOfParameters, unsigned int parameterTypes[], void * parameters[], CDotNetHandle *exception);
Purpose
Creates a .NET object specified by the name and assembly parameters. This function uses the .NET constructor for this object that matches the number and type of arguments you pass.
Parameters
| Input | ||||
| Name | Type | Description | ||
| assembly | CDotNetAssemblyHandle | The handle of the .NET assembly that defines the object to create.
|
||
| name | const char * | The full type name of the .NET object to create. | ||
| numberOfParameters | size_t | The number of 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.
|
||
| Output | ||||
| Name | Type | Description | ||
| instance | void * | The handle to the object this function creates. You must call CDotNetDiscardHandle to discard this handle when it is no longer needed. | ||
| 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.0 and later
