|
I have seen many discussions about this subject on this site. You may try a search to see if you can find them. Anyways, I use the first method for classes annd functions but the second for just about everything else. To me it is a matter of saving space.
John
|
|
|
|
|
I've used both styles, read code using both styles, debugged code using both styles, and as far as I'm concerned, I have no problem with either form. It's not really brace matching I have problems with -- it's parens (I once spent almost a day trying to debug a parser written in Scheme that boiled down to a missing end paren... paren matching? What's that?)
- Mike
|
|
|
|
|
The only reasonable reason for formating you code like this
class Cat {
// codes
};
is because the amount of space in published works (a.k.a books) is limited and you need to squeese the code so you can display it in less space. But formating your like this can lead to problems when debuging your code. I used this format some years back and I need to appoligise to anyone who is required to maintain it.
Trust in the code Luke. Yea right!
|
|
|
|
|
1. MFC dialog app is created
2. 2nd modeless dialog is created with extended style WS_EX_APPWINDOW, it's then shown and updated. The parent is set to null or desktop with SetParent(NULL) or SetParent(GetDesktopWindow())
3. Main dialog window is minimized, and as it is, the taskbar space for the non-modal disappears and the non-modal dialog is also minimized
4. NO, i repeat NO messages at all are sent to the non-modal dialog such as you would expect (ex. WM_SIZE message).
My Question is simple, what the heck is going on? How does one stop MFC from stealing the non-modal dialog's messages and reducing it automatically and removing it's taskbar space?
So far no one has been able to answer this
hey
|
|
|
|
|
Is it possible to customize the windows task bar (not the system tray) items so that you can change the text that appears next to the task bar icon for an application? Also could you replace the text that appears next to the icon by a bitmap.
That is instead of having "<mfc icon=""> MyApp.exe" appear in the windows task bar, you could have "<mfc icon=""> MyApplication" or "<mfc icon=""> 'A Bitmap'".
There seem to be a lot of articles on the system tray, but I havent seen any on the task bar.
Many thanks
3green
|
|
|
|
|
AFAIK Windows displays the Main Window title and it's icon on the task bar.
The title can be set with SetWindowText
in MFC, it's taken from the resource string IDR_MAINFRAME and optionally the current document name is added. The icon is the IDR_MAINFRAME icon resource.
Helped?
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
For a dialog-based app:
* Use SetWindowText of the main dialog to set the dialog's title - this text will also appear in the task bar
* Design two dialog resources, one 16x16, the other 32x32, use LoadImage to load them, then use the Dialog's SetIcon to set both the small and the large icon (the small one will be displayed as the dialog's system emnu, and in the taskbar. the large one will be displayed when Alt-Tabbing between apps, as EXE icon in IE, etc.)
There is no documented method (at least none I'm aware of) to show something else in the task bar than in the dialog title. However, there were one or two samples at CP showing how the Taskbar can be rearranged (it's really only a group of radio buttons) - they could have tips how you can customitze them.
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
What is the *real* purpose of this file and how to use it? Please tell me the secret (if somebody knows).
|
|
|
|
|
is there any function or idea which can monitor direcrory (delete, copy, replace, edit files and sub-directory) of windows 95?
thx
includeh10
|
|
|
|
|
One solution is FindFirstChangeNotification().
Kuphryn
|
|
|
|
|
you may want to go to amazon.com and looking up windows shell programming by dino espisito. They still sell it new on e-book
hey
|
|
|
|
|
When writing a MFC app (typically MDI type), how do people usually store the configuration options ? The samples I've looked at usually don't save them so you have to reset any option whe nyou restart the application.
Preferred methods or any to avoid ?
Thanks.
Elaine
The tigress is here
|
|
|
|
|
One solution is the registry.
Kuphryn
|
|
|
|
|
Registry is fine, but not the newest thing under the stars...
For "partially trusted" applications (kind of the .NET sandbox), there's Isolated Storage.
There was also a relatively quick way to serialize a class to an XML file in the Application Data of the current user - which might be the "modern" way.
[edit] damn! I'm just back from the C# forum - for good old MFC it's the registry[/edit]
"Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
sighist | Agile Programming | doxygen
|
|
|
|
|
You could always go with the ultra-modern INI file!
|
|
|
|
|
XML files are the best for saving configuration data!
|
|
|
|
|
|
After years of storing information in the registry, we are now standardizing on... ini files! The reason? MUCH lower support costs for our particular niche.
My company sells to schools and our products are typically run in networked situations. School networks
<gross generalization="">
1. Are run by sysadmins who have a poor understanding of their networks.
2. Are EXTREMELY concerned with locking down the system.
3. Often have some truly bizarre policies in place.
4. Often rebuild a standard working environment on every login.
We have found that our customers like being able to edit, copy and move a straight-forward text file and they can usually solve their problems themselves. With our old registry-based solution we spent enormous amounts of time trying to make our system support their (often bizarre) needs and then explaining the solution to them.
Paul Hooper
If you spend your whole life looking over your shoulder, they will get you from the front instead.
|
|
|
|
|
What is the best way to access large arrays of numberic values to use in separate class functions?
Thanks for any help in advance.
|
|
|
|
|
oops! fat fingered numeric.
|
|
|
|
|
Use vectors:
#include <vector>
using namespace std;
vector<int> a;
a.push(100);
a.push(200);
.
.
.
|
|
|
|
|
|
thanks for the reply!
Where would i locate this code so that it is accessible by all functions within a class?
|
|
|
|
|
how to get the registers - REGS in other compilers - in vcpp6.REGS is not even found in the msdn when searched!!
|
|
|
|
|
Try looking up the _asm keyword. If you are trying to connect assembly language code to a higher level language, lookup "calling conventions".
Software Zen: delete this;
|
|
|
|