Solved

Prefix for Windows controls....

Posted on 2000-02-25
4
414 Views
Last Modified: 2013-11-20
I was reading through some of the Hungarian Notation, and I began to wonder about the prefixes in the variable names. If I create an edit control and use DDX to access it, what prefix should I use? Are there any standard prefixes to all Windows controls? Is it, m_edit...., m_combo and so on? All suggections are appreciated....
0
Comment
Question by:joakimf
4 Comments
 
LVL 1

Expert Comment

by:Deckmeister
Comment Utility
Hi,

I use the same name than the control's ID. For instance, you create a editbox, a listbox and a tree control.
Then, you would have :
IDC_EDIT_DOGNAME   -> m_EditDogName
IDC_LIST_DOGS      -> m_ListDogs (usually I write m_ListOfDogs)
IDC_TREE_BREEDINGS -> m_TreeBreedings (or m_TreeOfBreedings)

And so on.
I think it works fine, because you always know the data type you work with.

But I don't know official standard prefixes to control variables.
0
 
LVL 12

Expert Comment

by:migel
Comment Utility
Hi!
I usually use prefix m_wnd....CtrlType
where ... - is control name -
and CtrlType - is its type
for example for Edit control for input Num1:
m_wndNum1Edit
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
Comment Utility
> Are there any standard prefixes to all Windows controls?

No, there isn't. The Hungarian Whitepaper predates MFC by about three years.

Some people do this:

   m_wndFirstName
   m_wndLastName
   m_wndExempt

and that lets you know they're windows, but doesn't tell you the type.  Some people do

   m_editFirstName
   m_editLastName
   m_checkExempt  

and that's better (in my opinion).

It's really a preference thing, and you need to decide for yourself (and maybe your team or organization) what works best for you. Besides: nobody _really_ follows Hungarian fully, anyway.

..B ekiM
0
 
LVL 1

Author Comment

by:joakimf
Comment Utility
Thanks for your comments
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now