SetFormattingOptions
- Updated2023-02-21
- 3 minute(s) read
SetFormattingOptions
LabWindows/CVI ActiveX Server Interface
CVI_AppSetFormattingOptions (CAObjHandle objectHandle, ERRORINFO *errorInfo, enum CVIEnum_CVIFormattingBracketStyle bracketStyle, long indentSwitch, long indentCase, long indentLabels, long indentPreprocessor, long indentComment, long breakClosingBrackets, long breakElseIfs, long alignPointer, long tabLength, long expandTAB, long reserved1, long reserved2, long reserved3, long reserved4, long *returnValue);
![]() |
Note This function signature is shown as it appears when you create a client using the LabWindows/CVI ActiveX Controller Wizard. If you create a client for the LabWindows/CVI ActiveX server interface using a different development environment, this function might be exposed differently. Some of the parameters documented here, such as objectHandle or errorInfo, are not applicable if you write a client using a different development environment. |
Purpose
Sets the indentation formatting for the source file and lines specified in the FormatFileSelection function.
Parameters
Input | ||
Name | Type | Description |
objectHandle | CAObjHandle | Specifier for a particular ActiveX object that is currently in memory. Obtain this handle from CVI_NewApp, CVI_OpenApp, CVI_ActiveApp, or an ActiveX method or property. All of the methods that you can apply to a particular object are grouped under a single class in the function tree. The name of the class corresponds to the type of the object to which this handle refers. |
bracketStyle | enum CVIEnum_CVIFormattingBracketStyle |
Sets the bracket style in the specified file and on the specified lines. You can specify one of the following constants:
|
indentSwitch | long | Specifies whether to indent the case statements within a switch statement. |
indentCase | long | Specifies whether to indent the case statement in relation to the case header. LabWindows/CVI does not indent case statements without enclosing brackets. |
indentLabels | long | Specifies whether to indent labels one indentation level less than the current indentation level instead of being flushed left. |
indentPreprocessor | long | Specifies whether to indent multiline preprocessor definitions that end with a backslash. |
indentComment | long | Specifies whether to indent comments that begin in the first column. |
breakClosingBrackets | long | Specifies whether to break closing headers, such as else, from the immediately preceding closing brackets. |
breakElseIfs | long | Specifies whether to break else if headers into separate lines. |
alignPointer | long | Specifies whether to align the pointer or reference operator to the data type, the variable name, or the space between. |
tabLength | long | Specifies the number of spaces to use for a tab character. |
expandTAB | long | Specifies whether to replace tab characters with spaces as you edit the file. |
reserved1 | long | This parameter is reserved. You must pass 0 for this parameter. |
reserved2 | long | This parameter is reserved. You must pass 0 for this parameter. |
reserved3 | long | This parameter is reserved. You must pass 0 for this parameter. |
reserved4 | long | This parameter is reserved. You must pass 0 for this parameter. |
Output | ||
Name | Type | Description |
errorInfo | ERRORINFO * | When an ActiveX server function fails with the error code DISP_E_EXCEPTION, descriptive information about the error code is stored in this parameter. The information can include the error code, source, and description. It also can include a help file and help file context ID. When an ActiveX server function fails with the error codes DISP_E_PARAMNOTFOUND, DISP_E_TYPEMISMATCH, or E_INVALIDARG, the parameter position of the invalid argument may be stored in the errorParamPos member of this parameter. You can pass NULL for this parameter. |
returnValue | long * | The value that the LabWindows/CVI ActiveX server function returns. A negative value indicates that the LabWindows/CVI ActiveX server function returned an error. You can use GetCVIAutomationServerErrorString to get the description of a LabWindows/CVI ActiveX server error code. |
Return Value
Name | Type | Description |
status | HRESULT | A value indicating whether an error occurred. A negative error code indicates function failure. Error codes are defined in CVIversion\include\cviauto.h and <Program Files>\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\winerror.h. You can use CA_GetAutomationErrorString to get the description of an ActiveX Library error code. |