LVectorBase::EnableAlwaysEndNotification

#include "ltwrappr.h"

virtual L_BOOL LVectorBase::EnableAlwaysEndNotification(bEnable=TRUE)

L_BOOL bEnable;

/* flag that indicates whether to allow the calling of the LVectorBase::EndChanging member function */

Enables or disables the calling of the LVectorBase::EndChanging member function.

Parameter

Description

bEnable

Flag that indicates whether to enable or disable the calling of the LVectorBase::EndChanging member function if the operation on the bitmap failed. Possible values are:

 

Value

Meaning

 

TRUE

The LVectorBase::EndChanging() member function will be called even if the operation function returned an error code.

 

FALSE

The LVectorBase::EndChanging() member function will not be called if the operation function fails.

Returns

The previous setting.

Comments

Call this function to enable or disable the calling of the LVectorBase::EndChanging function if the operation on the bitmap failed. The EndChanging function is normally called only if the operation was successful. Calling EnableAlwaysEndNotification with bEnable = TRUE will cause the EndChanging() member function to be called even if the operation function returned an error code.

Required DLLs and Libraries

LVKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LVectorBase::StartChanging, LVectorBase::EndChanging, LVectorBase::EnableChangeNotification, LVectorBase::IsChangeNotificationEnabled, LVectorBase::IsAlwaysEndNotification, Class Members

Topics:

Vector Notification Messages

 

Vector Images: Change Notification

Example

class LMyVector: public LVectorBase
{
private:
   L_BOOL m_bChanged;
   virtual L_INT  StartChanging(L_UINT nChangeType,L_UINT nChangeCategory);
   virtual L_VOID EndChanging(L_UINT nChangeType,L_UINT nChangeCategory,L_INT nRetCode);
};
L_INT LMyVector::StartChanging(L_UINT nChangeType,L_UINT nChangeCategory)
{
   switch(nChangeType)
   {
   case NC_VECTOR_ROTATE:
      MessageBox(NULL, TEXT("StartChanging: NC_VECTOR_ROTATE"), TEXT(""), MB_OK);
      break;
   case NC_VECTOR_TRANSLATE:
      MessageBox(NULL, TEXT("StartChanging: NC_VECTOR_TRANSLATE"), TEXT(""), MB_OK);
      break;
   case NC_VECTOR_SCALE:
      MessageBox(NULL, TEXT("StartChanging: NC_TRANSFORM_SCALE"), TEXT(""), MB_OK);
      break;
      /*
      case ….:
      do other things
      */
   }
   return(LVectorBase::StartChanging(nChangeType,nChangeCategory));
}
L_VOID LMyVector::EndChanging(L_UINT nChangeType,L_UINT nChangeCategory,L_INT nRetCode)
{
   switch(nChangeType)
   {
   case NC_VECTOR_ROTATE:
      MessageBox(NULL, TEXT("EndChanging: NC_VECTOR_ROTATE"), TEXT(""), MB_OK);
      if(nRetCode==SUCCESS)
         m_bChanged=TRUE;
      break;
   case NC_VECTOR_TRANSLATE:
      MessageBox(NULL, TEXT("EndChanging: NC_VECTOR_TRANSLATE"), TEXT(""), MB_OK);
      if(nRetCode==SUCCESS)
         m_bChanged=TRUE;
      break;
   case NC_VECTOR_SCALE:
      MessageBox(NULL, TEXT("EndChanging: NC_VECTOR_SCALE"), TEXT(""), MB_OK);
      if(nRetCode==SUCCESS)
         m_bChanged=TRUE;
      break;
      /*
      case ….:
      do other things
      */
   }
   LVectorBase::EndChanging(nChangeType,nChangeCategory,nRetCode);
}
L_INT LVectorBase__EnableAlwaysEndNotificationExample(HWND hWnd, LVectorBase *pMyVector)
{
   L_INT nRet;
   UNREFERENCED_PARAMETER(hWnd);
   if (!pMyVector->IsChangeNotificationEnabled())
   {
      MessageBox(hWnd, TEXT("ChangeNotification NOT enabled.  Enabling..."), TEXT(""), MB_OK);
      pMyVector->EnableChangeNotification();
   }
   if (!pMyVector->IsAlwaysEndNotification())
   {
      MessageBox(hWnd, TEXT("EndNotification NOT enabled.  Enabling..."), TEXT(""), MB_OK);
      pMyVector->EnableAlwaysEndNotification();
   }
   
   //Change rotation
   VECTORPOINT rotatePoint;
   nRet = pMyVector->GetRotation(&rotatePoint);
   if(nRet != SUCCESS)
      return nRet;
   rotatePoint.x += 30.0F;
   rotatePoint.y -= 20.0F;
   rotatePoint.z += 50.0F;
   nRet = pMyVector->SetRotation(&rotatePoint);
   if(nRet != SUCCESS)
      return nRet;
   //Change translation
   VECTORPOINT translatePoint;
   nRet = pMyVector->GetTranslation(&translatePoint);
   if(nRet != SUCCESS)
      return nRet;
   translatePoint.x += 0.5F;
   nRet = pMyVector->SetTranslation(&translatePoint);
   if(nRet != SUCCESS)
      return nRet;
   //Change scale
   VECTORPOINT scalePoint;
   nRet = pMyVector->GetScale(&scalePoint);
   if(nRet != SUCCESS)
      return nRet;
   scalePoint.x *= 0.5F;
   scalePoint.y *= 0.5F;
   scalePoint.z *= 0.5F;
   nRet = pMyVector->SetScale(&scalePoint);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}