Probably a silly Q, but how do I set/clear "edit" box in CCombo w "Drop List" style?

Probably a silly Q, but how do I set/clear "edit" box in CCombo w "Drop List" style?

Post by Hans Lindber » Thu, 13 Nov 1997 04:00:00



Hi!
I'm kind of new to the M(other) F(*cking) C(lasses), sorry MFC, ;-] but
please bare with me.
I'm trying to get a bundle of controls ( in a Property Page with Wizard
style) to keep synced
with each other. One thing that's giving me a headache is the
comboboxes. I have a combobox
of drop list style that I need to set from a handler for a message
generated by another control.
I wan't the editbox, which as I gather isn't really an edit box in this
case because of the style, to
either be blanked or set to one of the strings in the drop down. I can't
seem to manage this!
I've tried SetWindowText("");  FindString() SetEditSel() followed by
Clear() but to no avail.
What's the deal?

PS Sorry about the obceneties, but I guess I'm not the only frustrated
MFC programmer so I hope
you understand, or am I?
Oh, migth as well go on a bit as I have your attention. I get the
feeling that MFC, or at least the
app studio kind of hides away way too much to make it really useful. I'm
I right or am I lost?
It might be that I haven't gotten the hang of OO and event driven stuff,
but there are loads of
useful events that the class wizard hides, like for example BN_CLICKED
in a CListBox.
You can get at it if you subclass CListBox, but you don't get much help,
do you?
It seems you have to know loads about everything when coding with MFC,
and you still
have too look more in the online help than on the code you're writing,
as there are more
exceptions than rules as to how different commands work what you can do
with different
objects.
 Supposing that I'm not a complete git, will it ever be "easy" or
intuitive to write code in MFC?

 
 
 

Probably a silly Q, but how do I set/clear "edit" box in CCombo w "Drop List" style?

Post by Michael Alsu » Thu, 13 Nov 1997 04:00:00


CListBox::SetCurSel ()

 
 
 

1. "own" vs "uses" vs "contains" vs "is a"

I am studing for a VB exam and the book I have mentions there are
relation types between objects. (New Riders pg. 22 "MCSD Visual Basic
6 Exams 70-175 and 70-176".  (FYI - I did take a course in Object
Oriented Design!)

The book does not give any examples, but I have come up with the
following examples for the relation types that the book says exist. I
came up with the examples etc. from another book by Kurata ( Doing
objects in Visual Basic 6".

My question is how is "contains" different from "has a" I cannot come
up with an example.

"is a" - example a programer "is a" employee. In VB this might be
called a subclass.

"uses" - a data screen "uses a" employee object. In VB this might be
called a collaborator.

"has a" - and employee "has a" time sheet. In VB this might be called
a container.

"contains" -

2. HELP: VC++ Array of CObList

3. ??? "VxD" or "Ring 0"-usage by dos-box-programm ???

4. NFS between 9.01 and 10.10 - will this work?

5. use Notepad or "edit" control to implement "edit as text"?

6. MODEM/COMMUNICATION PROGRAM ARCHIVE IS NOW ON THE WEB!

7. Removing "My Computer", "Recycle Bin" and "Network Neighborhood" from desktop

8. RR501 tranceiver and CM11A

9. Why "public" "private" "protected"

10. extern "FORTRAN", extern "Pascal", extern "Ada" ... ?

11. Changing from "no caption" to "caption" style

12. C style input and output "printf" and "scanf"

13. Edit Registry ("SYSTEM.DAT" & "USER.DAT")