LVectorDialog::GetString

#include "ltwrappr.h"

static L_INT LVectorDialog::GetString(uString, pString)

Gets the current string for the specified index.

Parameters

L_UINT32 uString

Index into a list of strings. For a list of the strings, refer to Dialog Strings.

L_TCHAR * pString

Pointer to the buffer to be updated with the current string.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Before calling this function, call LVectorDialog::GetStringLen to get the length of the text you want to retrieve.

Use LVectorDialog::SetString to modify the automated menu item.

Before calling this function, you must declare a variable as a pointer to a character string. Then, pass the variable in the pString parameter. This function will update the variable with the character string at the given index.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will set a custom font and string for the rotate dialog.

# include "Windowsx.h" 
 
L_INT LVectorDialog__GetStringExample(LVectorBase *pVector, HWND hWnd) 
{ 
   L_INT       nRet; 
   HFONT       hMyFont=NULL;  
   HDC         hDC;  
   L_TCHAR*    pszString=NULL;  
   L_UINT      uLen;  
   L_TCHAR     szNewCaption[] = TEXT("My New Rotate Caption"); 
 
   LVectorDialog VectorDlg(pVector);  
 
   hDC = GetDC(hWnd); 
 
   hMyFont = CreateFont( -MulDiv( 8, GetDeviceCaps(hDC, LOGPIXELSY), 72),  
                        0, 0, 0,  
                        FW_BOLD, FALSE, FALSE, FALSE,  
                        DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,  
                        DEFAULT_QUALITY, DEFAULT_PITCH,  
                        TEXT("Bones") );  
 
   if(VectorDlg.SetFont( hMyFont ) == NULL) 
      return FAILURE; 
 
   //get the default caption string  
   nRet = VectorDlg.GetStringLen( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, &uLen ); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   pszString = (L_TCHAR*) GlobalAllocPtr( GHND, uLen * sizeof( L_TCHAR ) ); //+1 for NULL 
 
   nRet = VectorDlg.GetString ( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, pszString );  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // display default caption string  
   MessageBox(hWnd, pszString, TEXT("Default Vector Dialog Rotate Caption"), MB_OK );  
 
   GlobalFreePtr( pszString );  
 
   // change caption string 
   nRet = VectorDlg.SetString( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, szNewCaption );  
   if(nRet != SUCCESS) 
      return nRet; 
 
   // now, display the dialog to see our changes 
   VectorDlg.EnablePreview(); 
 
   VectorDlg.EnableAutoProcess(); 
 
   nRet = VectorDlg.DoModalVectorRotate(); 
 
   if(VectorDlg.SetFont (NULL) == NULL) 
      return FAILURE;  
   ::DeleteObject( hMyFont );  
 
   ReleaseDC(hWnd, hDC); 
 
   return nRet; 
} 

Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Vector C++ Class Library Help