#include "ltwrappr.h"
static L_INT LVectorDialog::GetString(uString, pString)
L_UINT32 uString; |
index of a string |
L_TCHAR * 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. |
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
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 For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Functions: |
LVectorDialog::GetStringLen, LVectorDialog::SetString, Class Members |
Topics: |
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 stringnRet = VectorDlg.GetStringLen( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, &uLen );if(nRet != SUCCESS)return nRet;pszString = (L_TCHAR*) GlobalAllocPtr( GHND, uLen * sizeof( L_TCHAR ) ); //+1 for NULLnRet = VectorDlg.GetString ( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, pszString );if(nRet != SUCCESS)return nRet;// display default caption stringMessageBox(hWnd, pszString, TEXT("Default Vector Dialog Rotate Caption"), MB_OK );GlobalFreePtr( pszString );// change caption stringnRet = VectorDlg.SetString( VECTOR_DLGSTR_TRANSFORM_ROTATE_CAPTION, szNewCaption );if(nRet != SUCCESS)return nRet;// now, display the dialog to see our changesVectorDlg.EnablePreview();VectorDlg.EnableAutoProcess();nRet = VectorDlg.DoModalVectorRotate();if(VectorDlg.SetFont (NULL) == NULL)return FAILURE;::DeleteObject( hMyFont );ReleaseDC(hWnd, hDC);return nRet;}