|
Dear all,
how can get selected item in list box????
thx
|
|
|
|
|
You get the index of the element with the GetCurSel() function.
With the index you can get the text with GetText()
All the label says is that this stuff contains chemicals "... known to the State of California to cause cancer in rats and low-income test subjects." Roger Wright http://www.codeproject.com/lounge.asp?select=965687&exp=5&fr=1#xx965687xx
|
|
|
|
|
Iterate through the items in the list box using GetCount()
////// Check if the state of the item is set as selected
//////
for(int i=0;i<=m_pListBox.GetCount();i++)
m_pListBox.GetSel( i ) > 0 ? _T("true") : _T("false"));
//////Or use GetCurSel()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
m_ListBox.GetCurSel(); that return currently selected item
and use m_ListBox.GetText() for retrieves a string from ListBox
whitesky
|
|
|
|
|
In my project code i hv these two instruction. please explain thease:-
1. m_CDBFile.write(reinterpret_cast(&m_Header.nNoOfRecords),sizeof(m_Header.nNoOfRecords));
2. nRetVal = MoveFileEx(lpBuffer,lpSystemDir,MOVEFILE_REPLACE_EXISTING);
THANK YOU
|
|
|
|
|
1) 1 st Parameter- _Str
Characters to put into the stream.
You are typecasting m_Header.nNoOfRecords
2 nd Parameter- _Count
Count of characters to put into the stream.
This is self explanatory
2)The nRetVal is used to test if MoveFileEx was successful.The value is non zero in this case
From MSDN
lpExistingFileName // First Parameter to MoveFileEx
[in] Pointer to a null-terminated string that names an existing file or directory on the local computer.
lpNewFileName // Second Parameter to MoveFileEx
[in] Pointer to a null-terminated string that specifies the new name of lpExistingFileName on the local computer.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
MoveFileEx for move a file or directoy and whats m_CDBFile?
whitesky
|
|
|
|
|
Hi everyone,
I need to send data from a set of sensors via wi-fi to my PC. Once I have data in the PC, after making some operations with them, I have to send data again to the sensors, where there are a LCD to show a number.
Well, I don't know too much about wi-fi and I want someone to help me and start me in the wi-fi development. And how can I do this work.
Thank you in advance for your help and sorry of my bad english.
|
|
|
|
|
If you have an IP network google sockets
earl
|
|
|
|
|
Hi again,
Well, I think I need an emitter and a receiver, didn't I? So, with those devices, can I work with IP's?
|
|
|
|
|
Um, sorry, I thought you had some devices in mind.
So yes... if you want to send data via Wifi, you're going to need an emitter and a receiver. You should browse manufacturers of such devices and read the docs on their devices.
|
|
|
|
|
Hi,
OK, thank you very much, Earl. One last question, Any suggestion, please?
Thanks so much again.
|
|
|
|
|
Sorry, no -- it's not really what I do. Besides, it's going to depend on what type of sensors you have, how much data, how far, etc. Your best bet is probably to find integrated devices, though I do think there are wifi boxes that will let you run code on them that talks over serial, etc. Expensive though.
|
|
|
|
|
Hello everybody,
I want to add string values to combobox and in the Data tab i added the srings separating with a semi-colon.In the styles tab i set the Type to dropdown.But while executing i didn't get values.what was the mistake i did?
Please help me.
tejaswini
|
|
|
|
|
hi tejaswini,
u should not do like that.
if u seperate the strings with semicolon, it will come as one string.
if u want multiple strings Ctrl + Enter
|
|
|
|
|
tejaswini.g wrote: But while executing i didn't get values.
It is working fine for me. Is it in the dropdown?
|
|
|
|
|
|
Yes me toooooooooooooooooooooooooooooooooooo.
|
|
|
|
|
voorugonda prashanth wrote: u should not do like that.
if u seperate the strings with semicolon, it will come as one string.
this is first one
voorugonda prashanth wrote: Yes me toooooooooooooooooooooooooooooooooooo.
This is second one... seems contradictory to each other.
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
It's not working with me.It's not with dropdown.I think it's with the version.
I am using visual studio6.0.
And I got solution with Ctrl+Enter.
It's working fine.
thank u
tejaswini
|
|
|
|
|
You said that you have the combo box with Type as drop down and adding string in the data box.
Did you go to the resource editor. Click on the arrow button of the combo box and then drag it down to some size to show the drop down list.
If not you will need to do so . Everything else works.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
In visua studio 6, you should specify the data seperated by "new lines" not with semicolon. you can use Ctrl+Enter for the same purpose.
In Visual Studio 2003, in the property page, we can't add data in new lines, hence we specifies it using ";"
Seems it's clear
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
How we change the shape of the Button, please help me
thank you,
kanth
|
|
|
|
|
|
The question is slightly deviated but related to buttons and dynamic control, so hope i get some clue.
I like to autosize the owner draw button depending upon the text that it load dynamically based on localization strings. so some strings are large than others. Keeping this I override DrawItem in the inherited class from CButton.
The sample code is below
void CMyGraphicButton::DrawItem (LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CString cs;
CString cslong;
ASSERT(lpDrawItemStruct->CtlType == ODT_BUTTON);
LPCTSTR lpszText = (LPCTSTR) lpDrawItemStruct->itemData;
if (!lpszText || lpszText == (LPCTSTR)-1)
{
GetWindowText (cs);
}
else
cs = lpszText;
// now i m trying to resize , so let try to increase the size of button unconditioally
// I get
//lpDrawItemStruct>rcItem.left =0
//lpDrawItemStruct>rcItem.right =75
//lpDrawItemStruct>rcItem.top = 0
//lpDrawItemStruct>rcItem.bottom = 25
//As my button is on extreme right side of dialog so i tried to extend/increase the size of
// button of the left side as follows
lpDrawItemStruct>rcItem.left -= 25 ;
// but the above causes the text to be moved on right side insead of resize/increase the
//button size.
Any idea or help is appriciated.
Thanks
Anil
}
[AKS]
|
|
|
|