LVectorDialog::GetString

#include "ltwrappr.h"

static L_INT LVectorDialog::GetString(uString, pString)

L_UINT32 uString;

/* index of a string */

L_TCHAR L_FAR * pString;

/* pointer to the variable to be updated */

Gets the current string for the specified index.

Parameter

Description

uString

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

pString

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

Returns

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

LVKRN
LVDLG
LTFIL

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:

LVectorDialog::GetStringLen, LVectorDialog::SetString, Class Members

Topics:

Vector CommonDialogs

Example

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

# include "Windowsx.h"

L_VOID Example91(LVectorBase *pVector, HWND hWnd)
{
   HFONT hMyFont=NULL; 
   HDC hDC; 
   L_TCHAR L_FAR* 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") ); 
   VectorDlg.SetFont( hMyFont ); 
   
   //get the default caption string 
   VectorDlg.GetStringLen( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, &uLen ); 
   pszString = (L_TCHAR L_FAR*) GlobalAllocPtr( GHND, uLen * sizeof( L_TCHAR ) 1 ); //+1 for NULL
   VectorDlg.GetString ( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, pszString ); 
   
   // display default caption string 
   MessageBox(hWnd, pszString, TEXT("Default Vector Dialog Rotate Caption"), MB_OK ); 
   GlobalFreePtr( pszString ); 
   
   // change caption string
   VectorDlg.SetString( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, szNewCaption ); 
   
   // now, display the dialog to see our changes
   VectorDlg.EnablePreview();
   VectorDlg.EnableAutoProcess();
   VectorDlg.DoModalVectorRotate();
   VectorDlg.SetFont ( NULL ); 
   ::DeleteObject( hMyFont ); 
   ReleaseDC(hWnd, hDC);
}