_ShippingMethodManager::CreateMethodInstance
Use this method to create a new shipping method.
Definition
HRESULT __ShippingMethodManager::CreateMethodInstance(VARIANT*bOnDisk,VARIANT*sMethodId);
Parameters
bOnDisk
[in] A VARIANT containing a Boolean indicating whether or not to create the shipping method on disk. This parameter is usually set to True
sMethodId
[out, retval] A VARIANT containing a BSTR that is the method ID of the new method. Set to an empty string if the bOnDisk parameter is False.
Return Values
This method returns an HRESULT indicating whether or not it completed successfully. See the Error Values section for more details.
Error Values
This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.
Remarks
The sMethodId parameter contains valid data only if the method completes successfully.
If the shipping method is created to be saved on disk (the bOnSaved parameter is True), the function adds a new record to the current recordset with the enabled
column value set to zero (0) and the shipping
_method
_id
column set to the new shipping method ID.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.