|
Branislav wrote:
This windows message is used for a combo box.
Which is what the OP was inquiring about.
Branislav wrote:
If you have multiple choice...
You can't have multiple choices with a combobox.
Branislav wrote:
...but if you have a window control, the text of the control is copied but you never be sure which text will be copied.
This makes no sense. How could you not be sure what text will be retrieved?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Yes, you are right I am thinking about list box but in MSDN about potential message-map:
ON_CBN_SELCHANGE The selection in the list box of a combo box is about to be changed as a result of the user either clicking in the list box or changing the selection by using the arrow keys. When processing this message, the text in the edit control of the combo box can only be retrieved via GetLBText or another similar function. GetWindowText cannot be used.
|
|
|
|
|
Branislav wrote:
ON_CBN_SELCHANGE The selection in the list box of a combo box is about to be changed
Wrong. The CBN_SELCHANGE message is sent after the selection has changed.
Branislav wrote:
When processing this message, the text in the edit control of the combo box can only be retrieved via GetLBText or another similar function. GetWindowText cannot be used.
Wrong again. GetWindowText() can most certainly be used at this point, as the combobox has already been updated to reflect the new selection.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_ccombobox.3a3a.ccombobox.asp
says this :
ON_CBN_SELCHANGE The selection in the list box of a combo box is about to be changed as a result of the user either clicking in the list box or changing the selection by using the arrow keys. When processing this message, the text in the edit control of the combo box can only be retrieved via GetLBText or another similar function. GetWindowText cannot be used.
rrrado
|
|
|
|
|
That's all well and good, but MSDN is not always correct. Reality dictates that GetWindowText() can be used, and is what I always use in response to the CBN_SELCHANGE message. Go ahead, give it a try.
BTW, the link you meant to specify is here.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Are you wanting the index of the selected item, or the value of the selected item? In other words, if your listbox contained the following items:
Apple
Orange <<-- selected item
Kiwi The index of the selected item would be 1, while the value of the selected item would be Orange.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi,
hi i need some info abt using of autocad objects in VC++ application..
Basically its manipulation of autocad files via VC++ application...
So any links, books , any material will be useful..
cheers,
Super
------------------------------------------
Too much of good is bad,mix some evil in it
|
|
|
|
|
Hi all,
How should I show up a splashscreen while my application init ?
I am using MFC application wizard to create it(dialog based)
Thanks
|
|
|
|
|
|
Search MSDN for an October 1999 article by Paul DiLascia. It has a good splash screen implementation.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
my project use CFile and CTime objects classes of the MFC foundation class libraries. CTime objects can be used to represent dates between January 1, 1970, and January 18, 2038.
but problem will appear, when change the time of computer more then 2038, my software crack!!!
so... of cause I can replace the CTime object with COleDateTime object, but the other MFC object CFile use CTime object in his class, ......
What can I do for resolve this bug?
help me!
|
|
|
|
|
more info of this bug:
http://pw1.netcom.com/~rogermw/Y2038.html
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20912755.html
|
|
|
|
|
This may be of help. Use it myself.
http://www.codeguru.com/Cpp/Cpp/cpp_mfc/article.php/c775/[^]
Roger Allen - Sonork 100.10016
Strong Sad:
Clever I am? Next to no one.
Undiscovered and soggy.
Look up. Look down. They're around.
Probably laughing. Still, bright, watery.
Listed among the top. Ten.
Nine. Late night. Early morn.
Early mourn. Now I sleep.
|
|
|
|
|
|
I tried to include a CSplitterWnd in a CFormView, but CFormView does not has OnCreateClient, so I used OnCreate, and created a static CSplitterWnd.
CSplitterWnd mSplit; //inside the class derived from CFormView
//inside OnCreate
mSplit.CreateStatic(this, 1, 2);
mSplit.CreateView(0, 0, RUNTIME_CLASS(CEditView), CSize(150, 100), NULL);
mSplit.CreateView(0, 1, RUNTIME_CLASS(CEditView), CSize(150, 100), NULL);
but there is nothing in the CFormView. Sometimes it causes an assertion when I call MoveWindow on mSplit!!! Any help in implementing it in CFormView?
I also tried creating a CFrameWnd in CFormView, and then making the parent of mSplit as CFrameWnd, but still, nothing showed up. However, when I call MoveWindow in OnSize, the application crashed, but the splitters showed up!!!!
please help, dear gurus! thanks in advanced...
|
|
|
|
|
maybe this[^] would help
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Typically the CFrameWnd -derived class owns the splitter window. It then gets created in the OnCreateClient() method.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Hi,
In the following code I have got window handler of desktop window. Using that handle I am changing position of the icons on the desktop window. But I am failed to read text of any item using ListView_GetItemText macro. Where is my problem?
LPTSTR buf;
HWND hWndProgman = ::FindWindow("Progman", NULL);
HWND hListView;
hListView = ::GetWindow(hWndProgman, GW_CHILD);
hListView = ::GetWindow(hListView, GW_CHILD);
POINT ptPos;
RECT rBounds;
int iOffset = 16384;
int nCount = ListView_GetItemCount(hListView);
ListView_GetOrigin(hListView, &ptPos);
ListView_GetViewRect(hListView, &rBounds);
for( int i = 0; i < nCount; i++ )
{
ListView_GetItemText(hListView, i, 0, buf, 100);
ListView_GetItemRect(hListView, i, &rBounds, LVIR_BOUNDS);
if( ListView_GetItemPosition(hListView, i, &ptPos) )
{
ListView_SetItemPosition(hListView, i, ptPos.x-iOffset, ptPos.y-iOffset);
}
}
Thanks in advance.
Shoma
|
|
|
|
|
It's possible that it's not working because the listview belongs to a different application. For example, GetWindowText() will fail to retrieve text from a window owned by a different application.
Steve S
|
|
|
|
|
In visual studio 7.1,
I have ols path not wprking, so I need a new one.
Is there a way to enter it?
Is it possible to set up new SS provider ?
Thanks.
|
|
|
|
|
You will probably find more people qualified and willing to answer your question in the forum devoted to VB.Net. Here you're more likely to encounter snide comments than helpful suggestions. The folks who hang out in the VB.Net forum are familiar with the language you're using and may well have run into the same problem you're experiencing.
Will Build Nuclear Missile For Food - No Target Too Small
|
|
|
|
|
:-DGood job! This is exactly where he should have looked for a mentor. But even though many of us would enjoy teaching someone new, we do not have the time. Your suggetions where very good!
I do not know about you but I like this person already, since they are not looking for someone to do their work for them but are looking for knowledge so they can do it there self.
Hey, maybe someone emailed him directly and he has his mentor now.
INTP
|
|
|
|
|
I am really gald that someone actually took interest in me. Actually I am try to do up a scheduler program which run on system tray. I will try and look up for the books first. If I got problem can i ask the kind soul in this forum.
C++ Programming
|
|
|
|
|
Hi All,
I have a problem in my embedded VC++ which is as follows:
There is a Read Thread created during WM_CREATE event, which is supposed to read data from the COM1 port as and when it receives data.I have created the thread in such a way that it is active right from the point of creation - hReadThread = CreateThread (NULL, 0, PortRead, 0, 0, &dwThreadId);
The problem is I dont know why the data is not read from COM1 though the read thread is active right from start.
It would be very helpful if you could kindly help em out.
Thanx
Deepa.
|
|
|
|
|
Hi,
Are you sure that COM1 was not opened before your thread has started?
Sincerely Yours,
RadioShark
|
|
|
|