Properties
About this topic
This topic describes the following properties:
Blocking
VARIANT_BOOL Blocking
Description
Determines whether methods should block until completion or return immediately for asynchronous operation.
Acceptable values
• VARIANT_TRUE (C++) or True (Visual Basic .NET). The ActiveX control is forced to block or wait until a method completes before it returns control to the caller.
• VARIANT_FALSE (C++) or False (Visual Basic .NET). Returns control to the application immediately, and the caller should handle the events accordingly.
Default value
VARIANT_FALSE (C++) or False (Visual Basic .NET)
Blocking affects some methods differently. See each method’s description for the effect. Unless otherwise noted:
• In non-blocking mode (Block = VARIANT_FALSE or False), a method:
– Starts another thread of execution to perform the given method, returning control to the application immediately.
– Returns 0 on launching a new thread successfully; otherwise, returns nonzero, and an Error event is fired.
– If the method is successful, an event indicating completion is fired; if unsuccessful, an Error event is fired.
• In blocking mode (Block = VARIANT_TRUE or True), a method:
– Is executed.
– Returns 0 if it completes successfully; returns nonzero otherwise.
• Error message can be reviewed by calling GetLastError().
Visual C++ Example
// set the MiniHub in blocking mode
VARIANT_BOOL blocking=VARIANT_TRUE;
m_Minihub.PutBlocking (blocking);
// set the MiniHub in non-blocking mode
blocking=VARIANT_FALSE;
m_Minihub.PutBlocking (blocking);
// returns the blocking value
blocking = m_Minihub.GetBlocking ( );
// user should handle events if non-blocking!
Visual Basic .NET Example
‘set Labware MiniHub in blocking mode
Minihub1.Blocking=True
‘set Labware MiniHub in non-blocking mode
Minihub1.Blocking=False
‘returns the blocking value
Dim bMode as Boolean
bMode = Minihub1.Blocking
‘user should handle events if non-blocking!
ControlPicture
IPictureDisp*ControlPicture
Description
A read-only picture of the Labware MiniHub that can be used in the container’s application.
Parameters
None
Visual C++ Example
/* the CPicture class will be imported into your project
when the ActiveX is installed */
CButton button;
// create a button
CPicture MinihubPic;
// retrieve the picture
MinihubPic = m_Minihub.GetControlPicture();
// paint the bitmap onto the button
button.SetBitmap((HBITMAP) MinihubPic.GetHandle());
Visual Basic .NET Example
Dim iPicture As System.Drawing.Image = Minihub1.ControlPicture()
button.BackgroundImage = iPicture
Related information