L_VecDlgSetString

#include "lvdlg.h"

L_INT EXT_FUNCTION L_VecDlgSetString(uString, pszString)

L_UINT32 uString;

/* index of a string */

const L_TCHAR L_FAR * pszString;

/* character string that contains the string to set */

Sets the new string for the specified index

Parameter

Description

uString

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

pszString

Character string that contains the new string to set.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

To retrieve the character string for a specified index, use L_VecDlgGetStringLen to determine the length of the string and to allocate a buffer of appropriate size. Then call L_VecDlgGetString to retrieve the string.

Required DLLs and Libraries

LVDLG

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:

L_VecDlgGetStringLen, L_VecDlgGetString

Topics:

Vector Dialogs

Example

L_VOID TestFunc2(HWND hWnd, pVECTORHANDLE pVector)
{
   HFONT hMyFont=NULL;
   HDC hDC;
   L_TCHAR L_FAR* pszString=NULL;
   L_UINT uLen;
   L_TCHAR szNewCaption[] = TEXT("My New Rotate Caption");

   hDC = GetDC( NULL );

   /* set a custom font and string for the rotate dialog */
   /* NOTE, you should change the font name to a font on your system */
   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"));
   L_VecDlgSetFont( hMyFont );

   /* get the default caption string */
   L_VecDlgGetStringLen( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, &uLen );
   pszString = (L_TCHAR L_FAR*) GlobalAllocPtr( GHND, uLen * sizeof( L_TCHAR ) + 1 ); /* add 1, for the terminating NULL */
   L_VecDlgGetString( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, pszString );

   /* display default caption string */
   MessageBox( hWnd, pszString, TEXT("Default"), MB_OK );
   GlobalFreePtr( pszString );

   /* change caption string */
   L_VecDlgSetString ( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, szNewCaption );

   /* now, display the dialog to see our changes */
   L_VecDlgRotate( hWnd,
                   pVector,
                   NULL,
                   NULL,
                   VECTOR_DLG_SHOW_PREVIEW | VECTOR_DLG_AUTO_PROCESS, NULL, NULL );
                  
   L_VecDlgSetFont( NULL );
   DeleteObject( hMyFont );
   ReleaseDC( NULL, hDC );
}