Top  Previous  Next


Sets up a callback function which will be called when a client application modifies a feature value.

 SetWriteCallback(void* context, FeatureCallback callback);

where FeatureCallback type is defined as

    bool (*FeatureCallback)(void* context, const char* feature);

[in] void* context  
Address of the context in which the callback function will operate.  
[in] FeatureCallback callback  
Address of the callback function  
[in] const char* feature  
String containing the name of the feature that has just been modified by a client application.  

Return Values



This fragment of an MFC code uses a feature write callback to intercept requests for the change of the image size and modifies the image buffer and acquisition parameters accordingly:

* context, const
* feature)
          CGigemuDlg* dlg = (CGigemuDlg*) context;

int CGigemuDlg::onFeatureWrite(const char* feature)  
    if(CString(feature)=="SizeX" || CString(feature)=="SizeY")  
     delete imgBuf;  
     imgBuf=new (m_SizeX * m_SizeY)  
       return 0;  

      BOOL CGigemuDlg::OnInitDialog()
  m_pCamera->SetWriteCallback(this, &::onFeatureWrite);  


The write callback function is called after the value of the feature has just been modified by a client application. Therefore, the callback can be used to update those parameters of virtual camera application that are associated with the modified feature.

If the write command is ignored, your callback function must return False, otherwise it must return True. In the latter case GigESim will return an acknowledge packet to the client application.

If you are using a callback function in the main thread of the simulation application, make sure that no lengthy processing is done in the body of the function as otherwise the connection to the remote client may become broken.