Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Prefix for Windows controls....

Posted on 2000-02-25
4
Medium Priority
?
434 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 200 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

670 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