Admin Production ni-theme
Current Publication

Editing an ActiveX Method

LabWindows/CVI

Edit ActiveX Server Wizard — Edit ActiveX Method Panel

Use this dialog box to edit a method in your ActiveX interface. An ActiveX method is used to represent a function and, in that way, is similar to C functions.

  • Name—The name of your method. The method name must be a valid C identifier and must be less than 60 ASCII characters in length.
  • DISPID—The DISPID of your method. The DISPID must be a unique positive integer and is required for Dispatch, Dual, and Event interface methods. You can overwrite the generated DISPID and provide a different DISPID.
  • Help String—The help string for this method. LabWindows/CVI stores the help string in your server's type library.
  • Help Context—If you specified a help file for your server, enter the context ID for this method's help information. LabWindows/CVI stores the context ID in your server's type library.
  • Arguments—A list of the arguments of this method.
  • AddAdds a new argument to this method.
  • EditEdits the current argument in the list.
  • Delete—Deletes the current argument in the list.
  • Move Up—Moves the current argument up one position in the list.
  • Move Down—Moves the current argument down one position in the list.
  • User function prototype—The prototype for the C function you must implement for this ActiveX method.

ActiveX Method Considerations

Consider the following caveats about ActiveX Methods.

  • The return value of an ActiveX method is an HRESULT, which is a 32-bit data type that COM uses to indicate error status. You optionally can mark the last parameter of an ActiveX method as the logical return value of that method. As a result, some client development environments generate client code that treats this parameter as the return value.
    • S_OK—Success
    • E_UNEXPECTED—Catastrophic failure
    • E_OUTOFMEMORY—Out of memory
    • E_INVALIDARG—One or more arguments are invalid
    • E_POINTER—Invalid pointer
    • E_HANDLE—Invalid handle
    • E_FAIL—Unspecified error
    • E_ACCESSDENIED—General access denied error
    • E_ABORT—Operation aborted
  • ActiveX methods use the CVIFUNC (__stdcall) calling convention.