Solved

Prefix for Windows controls....

Posted on 2000-02-25
4
429 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Expert Comment

by:Deckmeister
ID: 2557460
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
ID: 2557961
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
ID: 2558989
> 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
ID: 2562273
Thanks for your comments
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

617 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