I would like to start by saying thanks to everyone who takes some time to view this thread and try to help.
I have a global static variable of type
static wchar_t d_sondi
, and a global static vector defined as
static vector<wchar_t*> vDubinaSonde;
. In my GUI, a button was added that should fill vector with text from edit control.
By checking the size of the vector, I have determined that fill works fine, but output of strings is not good.
When I output vectors content, it outputs last entry, instead of all elements.
Text is retreived by using GetDlgItemText();
Here is the handler for button control:
if( tip_gte == L"'Литогеотермална енергија'")
memset( &n_sondi, '\0', sizeof(n_sondi) );
GetDlgItemText( hwnd, IDC_EDIT15, n_sondi, 50 );
if( !wcslen(n_sondi) )
wsprintf( n_sondi, L"%s", L"0" );
memset( &d_sondi, '\0', sizeof(d_sondi) );
GetDlgItemText( hwnd, IDC_EDIT16, d_sondi, 50 );
if( !wcslen(d_sondi) )
wsprintf( d_sondi, L"%s", L"0" );
for( vector<wchar_t*>::size_type in = 0;
in < vDubinaSonde.size(); in ++ )
MessageBox( hwnd, vDubinaSonde[in], L"", MB_OK );
I have tried this code in console, and it works the way it should :
wchar_t test = L"123";
for( vector<wchar_t*>::size_type i = 0; i < v.size(); i++ )
wcout << v[i] << endl;
So why does it display only the last value in the vector, in the above code for button handler?
I work in MS Visual Studio Express 2008, on Windows XP, in C++, using pure WIN32 API.
If any other information is required ( source code or something similar ), please ask for it, I will more than gladly supply it.