×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Where to find the naming conventions followed in VC++ 6.0

Where to find the naming conventions followed in VC++ 6.0

Where to find the naming conventions followed in VC++ 6.0

(OP)
If any one knows where to find the naming conventions followed in VC++ please help me out.Waiting for your responses.
Thanx in Advance..
vrvijayaraj

RE: Where to find the naming conventions followed in VC++ 6.0

depends on what kind of naming convention?, variable naming?, etc.

Karl
kb244@kb244.8m.com

Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)

RE: Where to find the naming conventions followed in VC++ 6.0

(OP)
I want the naming convention followed in all the cases..
I think the question is clear..

RE: Where to find the naming conventions followed in VC++ 6.0

well heres a few, but if I dont know specifically want you want, not much help(naming convention isnt vital to the opperations of VC++)


Naming Conventions for MFC DLLs

The DLLs and libraries included in MFC follow a structured naming convention. This makes it easier to know which DLL or library you should be using for which purpose.

The shared MFC DLL version of MFC comes in a number of different forms. These forms are named according to the convention MFC[O¦D¦N]x0[U][D].DLL (where x is the MFC version number) as detailed in the following table. The import libraries needed to build applications or extension DLLs that use these DLLs have the same base name as the DLL but have a .LIB extension.

Shared DLL Naming Convention

DLL Description
MFCx0.DLL MFC DLL, ANSI Release version
MFCx0U.DLL MFC DLL, Unicode Release version
MFCx0D.DLL MFC DLL, ANSI Debug version
MFCx0UD.DLL MFC DLL, Unicode Debug version
MFCOx0D.DLL MFC DLL for Active technologies, ANSI Debug version
MFCOx0UD.DLL MFC DLL for Active technologies, Unicode Debug version
MFCDx0D.DLL MFC DLL for database, ANSI Debug version
MFCDx0UD.DLL MFC DLL for database, Unicode Debug version
MFCNx0D.DLL MFC DLL for network (sockets), ANSI Debug version
MFCNx0UD.DLL MFC DLL for network (sockets), Unicode Debug version
MFCSx0.LIB MFC DLL, statically-linked code, Release version
MFCSx0D.LIB MFC DLL, statically-linked code, Debug version


Note   The ActiveX control DLLs OC[D]x0[U][D].DLL are gone. ActiveX control support is now included in the MFC DLL listed in the preceding table.

Note   The MFCSx0[D].LIB libraries are used in conjunction with the DLL versions of MFC. These library files contain code that must be statically linked in the application or DLL.

If you are dynamically linking to the shared DLL version of MFC, whether it is from an application or from an extension DLL, you must include MFCx0.DLL with your product. If you require Unicode support in your application, include MFCx0U.DLL instead.

Note   The MFCx0.DLL and MFCx0U.DLL Retail version of the DLLs contain Active technologies, database, and network support in a single DLL. The Debug version maintains separate DLLs for these functional areas.

If you are statically linking your DLL to MFC, you must link it with one of the static MFC libraries. These versions are named according to the convention [N¦U]AFXCW[D].LIB as listed in the following table.

Feature Only in Professional and Enterprise Editions   Static linking to MFC is supported only in Visual C++ Professional and Enterprise Editions. For more information, seeVisual C++ Editions.

Static-Link Regular DLL Naming Conventions

DLL Description
NAFXCW.LIB MFC Static Link Library, Release version
NAFXCWD.LIB MFC Static Link Library, Debug version
UAFXCW.LIB MFC Static Link Library with Unicode support, Release version
UAFXCWD.LIB MFC Static Link Library with Unicode support, Debug version


Note   In earlier versions of MFC (before version 4.0), there were special DLL variants of the libraries with names in the form [N¦U]AFXDW[D].LIB. These variants no longer exist. Use the versions listed in the preceding table.

For a list of DLLs included with Visual C++ that can be distributed with your applications, see the file REDISTRB.WRI in the \OS\System directory on the Visual C++ CD-ROM.


Library Naming Conventions
Object-code libraries for MFC use the following naming conventions. The library names have the form

uAFXcWd.LIB

where the letters shown in italic lowercase are placeholders for specifiers whose meanings are shown in the table Library Naming Conventions below:

Library Naming Conventions

Specifier Values and Meanings
u ANSI (N) or Unicode (U)
c Type of program to create: C=all
d Debug or Release: D=Debug; omit specifier for Release


The default is to build a debug Windows ANSI application for the Intel® platform: NAFXCWD.Lib. All libraries — listed in the table Static Library Versions below — are included prebuilt in the MFC\Lib directory on the Visual C++ CD-ROM.

Static Library Versions

Library Description
NAFXCW.LIB Release version
NAFXCWD.LIB Debug version (default)
UAFXCW.LIB Release version with Unicode support
UAFXCWD.LIB Debug version with Unicode support


Note   If you need to build a library version, see the Readme.Txt file in the \MFC\Src directory. This file describes using the supplied makefile with NMake.



as far as naming convention goes inside of the VC++ language used by most MFC commands, you got stuff like bstr, ptr, i,l,etc, which are usally part of like Basic String, Pointer, Integer, Long, I have seen the way they split some variables type up, like LPSTR, Long Pointer String. is this what you mean?

Karl
kb244@kb244.8m.com

Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)

RE: Where to find the naming conventions followed in VC++ 6.0

(OP)
The last part of your answer , answers part of the quetion. I think now you know,what I mean. I do have the recent version of MSDN help installed in my system. From that also I couldn't find the naming conventions followed in the case different datatypes and variables. I know naming conventions are not vital to the operations of VC++ , But it can help you a lot if you know the naming conventions while you are refering to some help documents such as MSDN.
Hope now you are clear about my question and the need..
Please help if you can..

RE: Where to find the naming conventions followed in VC++ 6.0

I have the october '99 MSND (on these machines) we do have the April 2000 CDs, but I'll check on msdn.microsoft.com(Since its always the latest)

Karl
kb244@kb244.8m.com

Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)

RE: Where to find the naming conventions followed in VC++ 6.0

I found it, it's known as Hugarian Notations, here is a sniplet out of the MSDN article I found.
at this URL http://msdn.microsoft.com/library/default.asp?URL=/library/backgrnd/html/msdn_mfcgde.htm I assume it would have been found in your local copy of MSDN, if only we knew it was called Hungarian Notations, I know it was definitally a MFC convention.


Use Simplified Hungarian Notation
The following tables describe the subset of Hungarian notation used in MFC. Table 3 shows general prefix naming conventions. Note that all class names and structure names begin with the letter "C", and member variables are preceded by m_.

Table 3. General Prefix Naming Conventions

Prefix  Type  Example  
C  Class or structure  CDocument, CPrintInfo  
m_  Member variable  m_pDoc, m_nCustomers


You may notice the absence of static member variables in Table 3. Static member variables are not really members of the object (that is to say, the instantiation of the class). Static member variables are global variables whose "namespace" is within the context of a class. Since global variables are not prefixed, static member variables are not prefixed.

Table 4 lists the prefixes MFC uses for naming variables. If you use these naming conventions in your MFC-friendly classes, users of your classes will appreciate the consistency between your code and MFC.

Table 4. Variable Prefix Naming Conventions

Prefix  Type  Description  Example  
ch  char  8-bit character  chGrade  
ch  TCHAR  16-bit character if _UNICODE is defined  chName
b  BOOL  Boolean value  bEnabled
n  int  Integer (size dependent on operating system)  nLength
n  UINT  Unsigned value (size dependent on operating system)  nLength  
w  WORD  16-bit unsigned value  wPos  
l  LONG  32-bit signed integer  lOffset  
dw  DWORD  32-bit unsigned integer  dwRange  
p  *  Pointer  pDoc  
lp  FAR*  Far pointer  lpDoc  
lpsz  LPSTR  32-bit pointer to character string  lpszName  
lpsz  LPCSTR  32-bit pointer to constant character string  lpszName  
lpsz  LPCTSTR  32-bit pointer to constant character string if _UNICODE is defined  lpszName
h  handle  Handle to Windows object  hWnd  
lpfn  callback  Far pointer to CALLBACK function  lpfnAbort


Know and Use Other MFC Conventions
Consistency with MFC helps flatten the learning curve for your users since they will recognize the MFC conventions in your classes and already know what they mean.

Table 5 shows symbols generated and used by AppWizard and ClassWizard in MFC applications. You can also use these prefixes in classes and resource files in your MFC-friendly classes.

Table 5. Symbols Used by Applications

Prefix  Type of Symbol  Example  Range  
IDR_  Identification shared by multiple resources of different types.  IDR_MAINFRAME  1 to 0x6FFF
IDD_  Dialog resource  IDD_SPELL_CHECK  1 to 0x6FFF
HIDD_  Dialog-resource Help context  HIDD_SPELL_CHECK  0x20001 to 0x26FF  
IDB_  Bitmap resource  IDB_COMPANY_LOGO  1 to 0x6FFF  
IDC_  Cursor resource  IDC_PENCIL  1 to 0x6FFF  
IDI_  Icon resource  IDI_NOTEPAD  1 to 0x6FFF
ID_ _ Command from menu item or toolbar  ID_TOOLS_SPELLING  0x8000 to 0xDFFF  
HID_  Command Help context  HID_TOOLS_SPELLING  0x18000 to 0x1DFFF  
IDP_  Message-box prompt  IDP_INVALID_PARTNO  8 to 0xDFFF  
HIDP_  Message-box Help context  HIDP_INVALID_PARTNO  0x30008 to 0x3DFFF
IDS_  String resource  IDS_COPYRIGHT  1 to 0x7FFF  
IDC_  Control within dialog box  IDC_RECALC  8 to 0xDFFF  


Table 6 describes some macros used in the framework. For more information on the DEBUG macro, see the article "Diagnostics" in the Visual C++ Programmer’s Guide in the online documentation. The AFXAPI and CALLBACK macros mark specific types of MFC functions.

Table 6. Configuration Macros Used in MFC

Macro Name  Type of Macro  
_AFXDLL  Stand-alone dynamic-link library (DLL) version  
_ALPHA  Compilation for the DEC Alpha processor only  
_DEBUG  Debug version including diagnostics  
_MBCS  Compilation for multi-byte character sets  
_UNICODE  Enables Unicode in an application  
AFXAPI1 Function provided by MFC  
CALLBACK  Function called back via pointer  


1. Reserved for use by MFC.

Karl
kb244@kb244.8m.com

Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)

RE: Where to find the naming conventions followed in VC++ 6.0

(OP)
Hello kb244,

 Thanx a lot for helping me. At last I got what I wanted.

Regards..
vrvijayaraj.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close