CP网站的C++/MFC FAQ
The Code Project Visual C++ Forum FAQ
By Michael Dunn.
About This FAQ
Welcome to the FAQ for the CodeProject Visual C++ forum. This FAQ is a compilation of the most-often asked questions in the forum, and covers several C++ programming subjects. It is not a full-fledged C++ or Windows programming FAQ (there are plenty of those already), but rather it's meant to cover the topics that CodeProject readers ask about the most.
If you think of any questions that you feel should be covered in this FAQ, email me with the question and the answer.
NOTE: Please do not email me directly to ask individual questions. I can't be everyone's personal consultant. Also, don't post programming questions in the message area of this article. Use the CodeProject forums to ask your questions; that's what they're there for!
Thanks to Tim Deveaux, Anders Molin, and Christian Graus for their contributions to this FAQ, along with all the folks who have posted suggestions in the comments area and via email!
Contents
CodeProject forum questions
1.1
What's the best way to ask a question about code, so that I get a good answer?
1.2
Why don't my #include lines or template parameters show up right in the forum?
Compiling and linking questions
Debugging questions
3.1
Windows UI questions
Console program questions
5.1
5.2
5.3
How can I output text in different colors in a console application?
5.4
5.5
5.6
How can I run my console program without the console window popping up?
General C++ questions
MFC questions
Other Windows topics
8.1
I've written a service and it can't access mapped network drives. Why?
8.2
A program I've written doesn't load when it's run on a computer without Visual C++ installed. Why?
8.3
8.4
8.5
8.6
8.7
Links to other Resources
=======================================================
45 Day Series: CodeProject VC++ Forum Q&A - I
By ThatsAlok.
About This FAQ
Welcome to the FAQ for the CodeProject Visual C++ forum. This FAQ is a compilation of the most-often asked questions in the forum, and covers several C++ programming subjects. It is not a full-fledged C++ or Windows programming FAQ (there are plenty of those already), but rather it's meant to cover the topics that CodeProject readers ask about the most.
If you think of any questions that you feel should be covered in this FAQ, email me with the question and the answer.
NOTE: Please do not email me directly to ask individual questions. I can't be everyone's personal consultant. Also, don't post programming questions in the message area of this article. Use the CodeProject forums to ask your questions; that's what they're there for!
Thanks to Tim Deveaux, Anders Molin, and Christian Graus for their contributions to this FAQ, along with all the folks who have posted suggestions in the comments area and via email!
Contents
CodeProject forum questions
1.1
What's the best way to ask a question about code, so that I get a good answer?
1.2
Why don't my #include lines or template parameters show up right in the forum?
Compiling and linking questions
Debugging questions
3.1
Windows UI questions
Console program questions
5.1
5.2
5.3
How can I output text in different colors in a console application?
5.4
5.5
5.6
How can I run my console program without the console window popping up?
General C++ questions
MFC questions
Other Windows topics
8.1
I've written a service and it can't access mapped network drives. Why?
8.2
A program I've written doesn't load when it's run on a computer without Visual C++ installed. Why?
8.3
8.4
8.5
8.6
8.7
Links to other Resources
=======================================================45 Day Series: CodeProject VC++ Forum Q&A - I
Introduction
Nothing unusual... this article is a compilation of questions and answers which were asked between 10 December 2004 and 23 Jan 2005 (45 days) on the Code Project Visual C++ forum. Also, this is the first article of the 45 Days series. I hope, I will bring more on this series.
Thanks to people for their contributions on the CodeProject forum to help fellow peers in their need. I have changed some original comments to suit/maintain the look/feel of article (I beg apology for that). If I have missed something, please feel free to mail me or leave a comment at bottom.
Content
[10 Dec to 18 Dec 2004]
- Q 1.01 Is there any function to minimize the window?
- Q 1.02 How do I stop appearing of SQL Sever login dialog again and again?
- Q 1.03 How can I access USB port (COM 5)?
- Q 1.04 What window message is processed when the window is maximized or minimized ?
- Q 1.05 What is the most suitable solution for running a timer every 40 msec?
- Q 1.06 What is the syntax of WM_GETTEXT for retrieving text from an edit box?
- Q 1.07 How to create a dialog which is not the main window, but its parent window and owner window are all NULL, such as the conversation window in MSN Messenger?
- Q 1.08 How to capture WEBCAM using Visual C++ or API?
- Q 1.09 What does the ^ do in C++?
- Q 1.10 How do I do exponents in C++? If ^ is XOR...
- Q 1.11 How do we run an EXE file at Windows startup?
- Q 1.12 What's the difference between keyword and reserved word?
- Q 1.13 How can I prevent a dialog from resize and move?
- Q 1.14 How to write a .ini file of an application?
- Q 1.15 How to set the TAB order of a control at runtime manually?
- Q 1.16 What's the functionality of DEBUG_NEW?
- Q 1.17 What are the differences between a DLL and a LIB file?
- Q 1.18 Give me some method for determining the full path to my application ?
- Q 1.19 What are Guard bytes?
- Q 1.20 How to debug a running DLL?
[19 Dec to 27 Dec 2004]
- Q 2.01 How to connect a modem to the telephone?
- Q 2.02 How to identify a user who is having specific kinds of privileges (i.e. admin privilege, etc.)?
- Q 2.03 How to invoke a web service from a C++ project with a structure as parameter?
- Q 2.04 How can I count the total number of characters typed in a RichEdit control?
- Q 2.05 How to prevent an MFC dialog based app being displayed on the taskbar?
- Q 2.06 How to set the display resolution in Windows?
- Q 2.07 How do I send a specific key to a window?
- Q 2.08 I need to check somehow when a process starts or exits. Any ideas how we can do this?
- Q 2.09 How to convert between dialog units to pixels and vice versa?
- Q 2.10 How do I check what version of the compiler I am using?
- Q 2.11 How to output messages/text to screen at XP boot time from a Win32 console application?
- Q 2.12 How to use SetTimer( ) when in a MFC regular DLL?
- Q 2.13 Does anyone know how to upload files to a web server through HTTP by VC++?
- Q 2.14 How can I draw inside an Edit control?
[28 Dec 2004 to 5 Jan 2005]
- Q 3.01 How to get the network IP address of computers?
- Q 3.02 How to eliminate flickering when resizing a window?
- Q 3.03 How to find which window belongs to which exe file?
- Q 3.04 In there any inbuilt function call to read the amount of memory or disk free space?
- Q 3.05 How to print/preview multiple pages?
- Q 3.06 Any suggestion about burning CD "on the fly"?
- Q 3.07 Can somebody give me a list of the Virtual Key codes?
- Q 3.08 When do we use extern "C"? Is this a compiler-specific feature?
- Q 3.09 How to write a web link to Favorites folder?
- Q 3.10 Can anybody give me a code sample for getting the MS Outlook address book?
- Q 3.11 How to set window size of an MFC dialog at runtime?
- Q 3.12 How do I make a combo box non-editable?
- Q 3.13 How do I create a DSN programmatically?
- Q 3.14 How to show and hide the title bar of a modal dialog dynamically?
- Q 3.15 Could you provide me some resources (example: source code) to make global hotkeys in MFC?
- Q 3.16 How to add an icon to the system tray?
- Q 3.17 How to use a C based library in a C++ environment?
- Q 3.18 Which file is modified if I modify the project settings by pressing Alt+F7?
- Q 3.19 How to check if a file has been opened by any process or not?
- Q 3.20 My compiler points to WM_MOUSEWHEEL as "undeclared identifier", what is the problem?
[6 Jan to 14 Jan 2005]
- Q 4.01 How to set the font of CListCtrl header?
- Q 4.02 Can somebody refer me to the source code of ZMODEM?
- Q 4.03 How to use Crystal Reports in Visual C++?
- Q 4.04 Is there is any s/w, utility to produce Audio Effect?
- Q 4.05 How to detect what URL was clicked by a user?
- Q 4.06 Why threads are declared as static when used from a class?
- Q 4.07 Where does Windows store log regarding dial-up connections?
- Q 4.08 How to change the language in UI (User Interface) dynamically?
- Q 4.09 Any suggestion about Atomic clock and Time Zone Programming?
- Q 4.10 How to read data from sound card online?
- Q 4.11 What does IN/OUT mean when declaring variables?
- Q 4.12 How can I get a specific folder's sector position?
[15 Jan to 23 Jan 2005]
- Q 5.01 How to change the background color of Edit Box?
- Q 5.02 How to increase the height of the header of a listcontrol?
- Q 5.03 How to generate UNIQUE Key over the Network/Local computer?
- Q 5.04 How to get file-size of a file?
- Q 5.05 Does anybody know of an API for digital cameras?
- Q 5.06 How to hide & show menu bar dynamically?
- Q 5.07 Please give me an example of RegEnumValue?
- Q 5.08 How to disable/enable OK button in a property sheet?
- Q 5.09 How to get serial number of a Compact Disc (CD)?
- Q 5.10 How to check if remote computer exists?
- Q 5.11 How to create nested directories?
- Q 5.12 How to get the HWND of a dialog box?
- Q 5.13 How can I know if the user is pressing on a button for more than 250 msec?
浙公网安备 33010602011771号