SetFeatureStringValue
Top  Previous  Next

Description

Sets the string value of the specified feature.

[C++]
int
 SetFeatureStringValue(const char* feature, const char* value);


Parameters
[C/C++]

[in] const char* feature  
Name of the feature to assign the value to. Must be an existing feature of the string or enumerated type.  
 
[in] const char* value  
New value of the string feature or selected string value of the enumerated feature.  


Return Values


S_OK  
Success  
E_FAIL  
Failure  
E_NOINTERFACE  
Feature does not exist  
E_INVALIDARG  
Wrong feature type  
 

Example


This fragment of code instantiates a camera object, creates a feature of the string type and assigns a default value to it:

static CGevCamera* m_pCamera;  
m_pCamera = createCamera();  
 
m_pCamera->CreateFeature(FEATURE_TYPE_STRING, "CameraModel", "DeviceInformation", FEATURE_ACCESS_RW);  
m_pCamera->SetFeatureStringValue("CameraMode", "Simulator 1.2");  
 

Remarks

Depending on the type of the feature the Value argument has the following meaning:

Feature Type
Value
String
String value to be set
Enumerated
String value of an item to be selected in the enumerated list


This method is typically used to assign a default value to a feature. It can also be used as part of a feature-read callback in order to modify the value of the feature before it gets transmitted to a client application. See SetReadCallback for more details.