|
You need to surround your header file with include guards. Something similar to this:
#ifndef MYFILE_H
#define MYFILE_H
... The code of your header comes here
#endif
You need to replace MYFILE_H by something unique in your project. In general, you can simply use the filename.
|
|
|
|
|
Why not only
<br />
#if _MSC_VER > 1000<br />
#pragma once<br />
#endif // _MSC_VER > 1000<br />
at the top of the .h-file? Seems to work fine.
|
|
|
|
|
ensger wrote: at the top of the .h-file? Seems to work fine.
Yes, it will.
Way suggested by Cedric is one of the ways. And using pragma's make code dependent on particular compiler.
|
|
|
|
|
in headers, you shouldn't define variables. you should only declare extern variables, that means to the compiler that the variable has been defined somewhere in a c/cpp file ; it's the linker job to synthetize this.
|
|
|
|
|
Ayman Mashal wrote: and i want to know if its right to add #includes for the standard libraries in all files ?
Technically you can, but it's bad practice. Put them all in a single file common to all of your project. Since those files are not going to be changing, take advantage of precompiled headers by turning on precompiled headers for that single file.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
I need to customize menu completely. Means including the border of menu. From CP, I found that for complete customization, we have to use windows hook. Is there any other method to avoid windows hook?
- NS -
|
|
|
|
|
NS17 wrote: From CP, I found that for complete customization, we have to use windows hook
NS17 wrote: Is there any other method to avoid windows hook?
Owner drawn menu.
Refer this[^] section on CP.
|
|
|
|
|
Thank you. yes i reffered this article. and found that it is working using windows hook. i need an alternate way to avoid hook.
- NS -
|
|
|
|
|
NS17 wrote: yes i reffered this article.
No, you haven't. You might have seen one of them.
I can see this article explaining owner drawn[^] menu.
|
|
|
|
|
Yes I did refer the same. But it uses the windows hook.
- NS -
|
|
|
|
|
NS17 wrote: But it uses the windows hook
No, it don't.
I'm not sure what link you are refering to.
But, I can see owner drawn menu BCMenu .
|
|
|
|
|
prasad_som wrote: I can see owner drawn menu BCMenu
I checked the code and found that it does not deal with menu border. but i need to customize the border too.
- NS -
|
|
|
|
|
NS17 wrote: I checked the code and found that it does not deal with menu border. but i need to customize the border too
You need to use OnDrawItem for this purpose. It is the place where whole menu is drawn. You need to write code for drawing border of your interest ,too.
|
|
|
|
|
you mean the border of a menu item?
but i meant that i need to customize the total menu window border. DrawItem will not handle the non client area of the menu window...
- NS -
|
|
|
|
|
NS17 wrote: I found that for complete customization, we have to use windows hook.
What do you mean by customization? What on earth does a hook have to do with customization? You have probably misunderstood something.
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
Probably, he is refering to this[^] article.
|
|
|
|
|
I am reading this book :
http://www.iecc.com/linker/linker05.html. It says:
"Non-global symbols, usually for debuggers and crash dump analysis. These aren't really symbols needed for the linking process, but sometimes they are mixed in with global symbols so the linker has to at least skip over them. In other cases they can be in a separate table in the file, or in a separate debug info file."
For VC++ What is the procedure for cretaing pdb file and symbol table.
If i compile in debug mode.
1-) First compiler generate symbol table and put it in .obj file.
2-) Linker generate .pdb file and exe by using symbol table in .obj file. (but exe doent include symbol table)
or in debug mode linker doesnt destroy symbol table in obj file. Also it puts symbol table in exe.
So Are there 2 symbol tables both in exe and pdb file? Or one only in pdb file?
Which one is true? Or what is the compiling and linking procedure in VC++ (VS2005) ?
-- modified at 1:42 Tuesday 27th February, 2007
|
|
|
|
|
Hi,
Can anybody give me some links or ideas to explain "Reading and wrinting using wndows registry API" please....
Harsha
|
|
|
|
|
|
Use CRegKey
Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா
|
|
|
|
|
|
Registry functions.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
I have a doubt reagrading DeleteObject().
I created 25 solid brushes in a function and deleted all the brushes in other function.
Before creating the brush the GDIObject count was 18 (as per task manager).
After Creating 25 brushes the count was 43.
Now even after deleting 25 brushes the GDI object count was still 32 instead of 18.
Anybody plz tell me the reason..
Plz suggest any good GDI leak tester.
|
|
|
|
|
sruti_p wrote: Anybody plz tell me the reason..
Reading this[^] article will be of some help.
|
|
|
|
|
Is there any tool to detect GDI leaks & Memory Leaks for VS 2005 Application apart from Task Manager?
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|