Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

vrvijayaraj

Programmer
Jun 11, 2000
19
JP
If any one knows where to find the naming conventions followed in VC++ please help me out.Waiting for your responses. <br>Thanx in Advance..<br>vrvijayaraj
 
depends on what kind of naming convention?, variable naming?, etc. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>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)
 
I want the naming convention followed in all the cases..<br>I think the question is clear.. <br>
 
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++)<br><br><FONT FACE=monospace><br><b>Naming Conventions for MFC DLLs</b><br><br>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. <br><br>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[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.<br><br>Shared DLL Naming Convention<br><br>DLL Description <br>MFCx0.DLL MFC DLL, ANSI Release version <br>MFCx0U.DLL MFC DLL, Unicode Release version <br>MFCx0D.DLL MFC DLL, ANSI Debug version <br>MFCx0UD.DLL MFC DLL, Unicode Debug version <br>MFCOx0D.DLL MFC DLL for Active technologies, ANSI Debug version <br>MFCOx0UD.DLL MFC DLL for Active technologies, Unicode Debug version <br>MFCDx0D.DLL MFC DLL for database, ANSI Debug version <br>MFCDx0UD.DLL MFC DLL for database, Unicode Debug version <br>MFCNx0D.DLL MFC DLL for network (sockets), ANSI Debug version <br>MFCNx0UD.DLL MFC DLL for network (sockets), Unicode Debug version <br>MFCSx0.LIB MFC DLL, statically-linked code, Release version <br>MFCSx0D.LIB MFC DLL, statically-linked code, Debug version <br><br><br>Note&nbsp;&nbsp;&nbsp;The ActiveX control DLLs OC[D]x0[D].DLL are gone. ActiveX control support is now included in the MFC DLL listed in the preceding table.<br><br>Note&nbsp;&nbsp;&nbsp;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.<br><br>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.<br><br>Note&nbsp;&nbsp;&nbsp;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.<br><br>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.<br><br>Feature Only in Professional and Enterprise Editions&nbsp;&nbsp;&nbsp;Static linking to MFC is supported only in Visual C++ Professional and Enterprise Editions. For more information, seeVisual C++ Editions.<br><br>Static-Link Regular DLL Naming Conventions<br><br>DLL Description <br>NAFXCW.LIB MFC Static Link Library, Release version <br>NAFXCWD.LIB MFC Static Link Library, Debug version <br>UAFXCW.LIB MFC Static Link Library with Unicode support, Release version <br>UAFXCWD.LIB MFC Static Link Library with Unicode support, Debug version <br><br><br>Note&nbsp;&nbsp;&nbsp;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.<br><br>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.<br></font><br><FONT FACE=monospace><br><b>Library Naming Conventions</b><br>Object-code libraries for MFC use the following naming conventions. The library names have the form<br><br>uAFXcWd.LIB<br><br>where the letters shown in italic lowercase are placeholders for specifiers whose meanings are shown in the table Library Naming Conventions below:<br><br>Library Naming Conventions<br><br>Specifier Values and Meanings <br>u ANSI (N) or Unicode (U) <br>c Type of program to create: C=all <br>d Debug or Release: D=Debug; omit specifier for Release <br><br><br>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.<br><br>Static Library Versions<br><br>Library Description <br>NAFXCW.LIB Release version <br>NAFXCWD.LIB Debug version (default) <br>UAFXCW.LIB Release version with Unicode support <br>UAFXCWD.LIB Debug version with Unicode support <br><br><br>Note&nbsp;&nbsp;&nbsp;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.<br><br></font><br><br>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?<br> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>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)
 
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.<br>Hope now you are clear about my question and the need..<br>Please help if you can..<br><br>
 
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) <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>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)
 
I found it, it's known as Hugarian Notations, here is a sniplet out of the MSDN article I found.<br>at this URL <i><A HREF=" TARGET="_new"> 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.<br><br><FONT FACE=monospace><br><b>Use Simplified Hungarian Notation </b><br>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 &quot;C&quot;, and member variables are preceded by m_. <br><br>Table 3. General Prefix Naming Conventions <br><br>Prefix&nbsp;&nbsp;Type&nbsp;&nbsp;Example&nbsp;&nbsp;<br>C&nbsp;&nbsp;Class or structure&nbsp;&nbsp;CDocument, CPrintInfo&nbsp;&nbsp;<br>m_&nbsp;&nbsp;Member variable&nbsp;&nbsp;m_pDoc, m_nCustomers <br><br><br>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 &quot;namespace&quot; is within the context of a class. Since global variables are not prefixed, static member variables are not prefixed. <br><br>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. <br><br>Table 4. Variable Prefix Naming Conventions <br><br>Prefix&nbsp;&nbsp;Type&nbsp;&nbsp;Description&nbsp;&nbsp;Example&nbsp;&nbsp;<br>ch&nbsp;&nbsp;char&nbsp;&nbsp;8-bit character&nbsp;&nbsp;chGrade&nbsp;&nbsp;<br>ch&nbsp;&nbsp;TCHAR&nbsp;&nbsp;16-bit character if _UNICODE is defined&nbsp;&nbsp;chName <br>b&nbsp;&nbsp;BOOL&nbsp;&nbsp;Boolean value&nbsp;&nbsp;bEnabled <br>n&nbsp;&nbsp;int&nbsp;&nbsp;Integer (size dependent on operating system)&nbsp;&nbsp;nLength <br>n&nbsp;&nbsp;UINT&nbsp;&nbsp;Unsigned value (size dependent on operating system)&nbsp;&nbsp;nLength&nbsp;&nbsp;<br>w&nbsp;&nbsp;WORD&nbsp;&nbsp;16-bit unsigned value&nbsp;&nbsp;wPos&nbsp;&nbsp;<br>l&nbsp;&nbsp;LONG&nbsp;&nbsp;32-bit signed integer&nbsp;&nbsp;lOffset&nbsp;&nbsp;<br>dw&nbsp;&nbsp;DWORD&nbsp;&nbsp;32-bit unsigned integer&nbsp;&nbsp;dwRange&nbsp;&nbsp;<br>p&nbsp;&nbsp;*&nbsp;&nbsp;Pointer&nbsp;&nbsp;pDoc&nbsp;&nbsp;<br>lp&nbsp;&nbsp;FAR*&nbsp;&nbsp;Far pointer&nbsp;&nbsp;lpDoc&nbsp;&nbsp;<br>lpsz&nbsp;&nbsp;LPSTR&nbsp;&nbsp;32-bit pointer to character string&nbsp;&nbsp;lpszName&nbsp;&nbsp;<br>lpsz&nbsp;&nbsp;LPCSTR&nbsp;&nbsp;32-bit pointer to constant character string&nbsp;&nbsp;lpszName&nbsp;&nbsp;<br>lpsz&nbsp;&nbsp;LPCTSTR&nbsp;&nbsp;32-bit pointer to constant character string if _UNICODE is defined&nbsp;&nbsp;lpszName <br>h&nbsp;&nbsp;handle&nbsp;&nbsp;Handle to Windows object&nbsp;&nbsp;hWnd&nbsp;&nbsp;<br>lpfn&nbsp;&nbsp;callback&nbsp;&nbsp;Far pointer to CALLBACK function&nbsp;&nbsp;lpfnAbort <br><br><br>Know and Use Other MFC Conventions <br>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. <br><br>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. <br><br>Table 5. Symbols Used by Applications <br><br>Prefix&nbsp;&nbsp;Type of Symbol&nbsp;&nbsp;Example&nbsp;&nbsp;Range&nbsp;&nbsp;<br>IDR_&nbsp;&nbsp;Identification shared by multiple resources of different types.&nbsp;&nbsp;IDR_MAINFRAME&nbsp;&nbsp;1 to 0x6FFF <br>IDD_&nbsp;&nbsp;Dialog resource&nbsp;&nbsp;IDD_SPELL_CHECK&nbsp;&nbsp;1 to 0x6FFF <br>HIDD_&nbsp;&nbsp;Dialog-resource Help context&nbsp;&nbsp;HIDD_SPELL_CHECK&nbsp;&nbsp;0x20001 to 0x26FF&nbsp;&nbsp;<br>IDB_&nbsp;&nbsp;Bitmap resource&nbsp;&nbsp;IDB_COMPANY_LOGO&nbsp;&nbsp;1 to 0x6FFF&nbsp;&nbsp;<br>IDC_&nbsp;&nbsp;Cursor resource&nbsp;&nbsp;IDC_PENCIL&nbsp;&nbsp;1 to 0x6FFF&nbsp;&nbsp;<br>IDI_&nbsp;&nbsp;Icon resource&nbsp;&nbsp;IDI_NOTEPAD&nbsp;&nbsp;1 to 0x6FFF <br>ID_ _ Command from menu item or toolbar&nbsp;&nbsp;ID_TOOLS_SPELLING&nbsp;&nbsp;0x8000 to 0xDFFF&nbsp;&nbsp;<br>HID_&nbsp;&nbsp;Command Help context&nbsp;&nbsp;HID_TOOLS_SPELLING&nbsp;&nbsp;0x18000 to 0x1DFFF&nbsp;&nbsp;<br>IDP_&nbsp;&nbsp;Message-box prompt&nbsp;&nbsp;IDP_INVALID_PARTNO&nbsp;&nbsp;8 to 0xDFFF&nbsp;&nbsp;<br>HIDP_&nbsp;&nbsp;Message-box Help context&nbsp;&nbsp;HIDP_INVALID_PARTNO&nbsp;&nbsp;0x30008 to 0x3DFFF <br>IDS_&nbsp;&nbsp;String resource&nbsp;&nbsp;IDS_COPYRIGHT&nbsp;&nbsp;1 to 0x7FFF&nbsp;&nbsp;<br>IDC_&nbsp;&nbsp;Control within dialog box&nbsp;&nbsp;IDC_RECALC&nbsp;&nbsp;8 to 0xDFFF&nbsp;&nbsp;<br><br><br>Table 6 describes some macros used in the framework. For more information on the DEBUG macro, see the article &quot;Diagnostics&quot; in the Visual C++ Programmer’s Guide in the online documentation. The AFXAPI and CALLBACK macros mark specific types of MFC functions. <br><br>Table 6. Configuration Macros Used in MFC <br><br>Macro Name&nbsp;&nbsp;Type of Macro&nbsp;&nbsp;<br>_AFXDLL&nbsp;&nbsp;Stand-alone dynamic-link library (DLL) version&nbsp;&nbsp;<br>_ALPHA&nbsp;&nbsp;Compilation for the DEC Alpha processor only&nbsp;&nbsp;<br>_DEBUG&nbsp;&nbsp;Debug version including diagnostics&nbsp;&nbsp;<br>_MBCS&nbsp;&nbsp;Compilation for multi-byte character sets&nbsp;&nbsp;<br>_UNICODE&nbsp;&nbsp;Enables Unicode in an application&nbsp;&nbsp;<br>AFXAPI1 Function provided by MFC&nbsp;&nbsp;<br>CALLBACK&nbsp;&nbsp;Function called back via pointer&nbsp;&nbsp;<br><br><br>1. Reserved for use by MFC.<br></font> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>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)
 
Hello kb244,<br><br>&nbsp;Thanx a lot for helping me. At last I got what I wanted.<br><br>Regards..<br>vrvijayaraj.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top