|
try following code.
if( ListBox1.GetCount() > 0 )
{
CString csText;
ListBox1.GetText( 0, csText );
ListBox2.AddString( csText );
ListBox1.DeleteString( 0 );
}
where ListBox1 is the control variable for the listbox 1 and ListBox2 is the control variabale for the listbox 2.
nave
|
|
|
|
|
My program had run already, I really thank for your help Naveen R. However, the problem here is I want the string will be send continuosly when I push Send button once only.
One more question I would like ask you that how to write all string in a Listbox control to file .txt and read string in text file to Listbox control.
Please help me solve this problem.
|
|
|
|
|
CStdioFile File;
File.Open( _T("C:\\listboxdata.dat"), CFile::modeCreate|CFile::modeWrite );
int nCount = m_list.GetCount();
for( int nIdx =0;nIdx< nCount;nIdx++ )
{
CString csText;
m_list.GetText( nIdx, csText );
File.WriteString( csText );
}
File.Close();
Do the reverse for reading...
nave
|
|
|
|
|
Can you show your code how do you use of it
|
|
|
|
|
Any body kwown please show me how to use List Controlfor in my case that is explained as following:
In my dialog, I created two List Control 1 and List Control 2 with multiline and 1 button Send. So when I push button send the String ar row 1 form List control 1 will be send to List control 2, that means the string in row 1 of List control 1 will be disappeared and insert to row 1 of List control 2, the sequence is run step by step up to there is no string in List control 1
Thank very much.
|
|
|
|
|
Same question isnt helpfuls for get answer
|
|
|
|
|
All,
Did any one used the MS script control for developing, executing VBScripts from the VC++ application ?
Provide me details regarding, how to use the script engine to aware of the VBScript code, what are all the things that I need to take care before and after executing the VBScript from my application developed using VC++.
Are there any tutorials which talks about these topics ?
Any suggestions or Links, please let me know in detail.
Thanks in advance,
AKS
|
|
|
|
|
Any inputs from anybody from this forum?
|
|
|
|
|
Hi all,
How can I set the focus to a MessageBox. For example: When a certain key is pressed, I show a messagebox asking the user a question. If the user would answer No the program continues as normal. And when the user presses that same key the messagebox displays, but behind the application.
Makes sense ??
Thanx in advance
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
try this.
MessageBox(GetFocus(),
"String to be displayed",
"Title",
MB_TASKMODAL | MB_YESNO).
Appu..
"If you judge people, you have no time to love them."
|
|
|
|
|
Thank you NiceNaidu, it seems like it did the job ...
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
I wants to get the full path of desktop and my document folder.
Can some one suggest how to do the same in VC++
|
|
|
|
|
|
Thanks for quick reply. I was just looking for this function
|
|
|
|
|
SHGetFolderPath()
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.5 [^]: A free RSS/Atom feed reader with support for Code Project. 50% discount on the paid editions for CP members!
|
|
|
|
|
I need a code(working ) for RSA for multiplying 2 large (512 bit prime number)
normal int is 32
i thought of arrays, but dunno how to do with arrays so am asking u all. hope some of u have worked with RSA
Deepchand P
Software Developer
Optiwise Solutions
|
|
|
|
|
Have you consulted any literature by R, S, or A?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hy
I am a newby in encoding/decoding. I am writting a function in C++ that would decode an URL encoded string. It works fine if the string does not contain unicode characters. Whenever I find a "%" I convert the fallowing two digit number from hex to int and add to the returning string the character corespounding to the int. When the URL contains unicode characters there is a "u" after the "%" fallowed by a 4 digit hex. I managed to convert the for digit hex to int. But I am not able to get the character corespounding to this int.
Could anyone give some advice ?
10x in advance
Bobby
bogdanaldo
|
|
|
|
|
Try using the following code for encoding and decoding the URL
CString URLDecode(const CString& inStr)
{
CString res;
for (int x = 0; x < inStr.GetLength(); x++)
{
if (inStr.GetAt(x) == _T('%') && x + 2 < inStr.GetLength() && IsHexDigit(inStr.GetAt(x+1)) && IsHexDigit(inStr.GetAt(x+2)))
{
TCHAR hexstr[3];
_tcsncpy(hexstr, inStr.Mid(x+1, 2), 2);
hexstr[2] = _T('\0');
x += 2;
res.AppendChar((TCHAR)_tcstoul(hexstr, NULL, 16));
}
else
{
res.AppendChar(inStr.GetAt(x));
}
}
return res;
}
CString URLEncode(const CString& sInT)
{
CStringA sIn(sInT);
LPCSTR pInBuf = sIn;
CString sOut;
LPTSTR pOutBuf = sOut.GetBuffer(sIn.GetLength() * 3);
if(pOutBuf)
{
while (*pInBuf)
{
if (_ismbcalnum((BYTE)*pInBuf))
*pOutBuf++ = (BYTE)*pInBuf;
else
{
*pOutBuf++ = _T('%');
*pOutBuf++ = toHex((BYTE)*pInBuf >> 4);
*pOutBuf++ = toHex((BYTE)*pInBuf % 16);
}
pInBuf++;
}
*pOutBuf = _T('\0');
sOut.ReleaseBuffer();
}
return sOut;
}
-- modified at 6:27 Monday 19th February, 2007
|
|
|
|
|
please use <pre></pre> !!!
|
|
|
|
|
Are you looking for something like UrlCanonicalize() , or maybe the UrlEescape() /UrlUnescape() pair?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to start a thread at a particular interval
like if i set it at 4 sec then that thread should run every 4th sec..
How shold i set this timer
Can anybody help me in this...
thanxs in advance
|
|
|
|
|
please set a nickname in your profile so that everybody can identify you.
BTW, are you using MFC ? is so, you can use the CWnd::SetTimer() function for this purpose
|
|
|
|
|
toxcct wrote: please set a nickname in your profile so that everybody can identify you.
Since s/he continues to receive help, what incentive does s/he have for complying?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
because if s/he continues, fire will fall on her/his head
|
|
|
|