|
i just found the line that does it in the .rc file
EXSTYLE WS_EX_APPWINDOW
i have added the above lines to the correct sections in the .rc file using notepad but how is this ment to be added when using visual studio 6
as the above way im sure isnt the right way
|
|
|
|
|
i'm quite sure you're calling that login dialog as modal from the Main dialog's OnInitDialog() function... aren't you ?!
|
|
|
|
|
yes, that is correct, while the other dialog is called once a button is click in the main dialog
is this having an effect?
|
|
|
|
|
I want to write some articles for the forum, how to do (publish) that?
A special image tool for Windows C++ programmers, don't miss it!
A nice hyper tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
|
right, but how to navigate to these pages if not clicking links given by you?
A special image tool for Windows C++ programmers, don't miss it!
A nice hyper tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
sorry, wasn't thinking...
Look at the top right hand menu on every page then Articles / Submit an Article
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
I like to do a “printscreen” on a window. Can I use the windows HWND to accomplish that in some way?
All tips are welcomed.
_____________________________
...and justice for all
APe
|
|
|
|
|
search for "screen capture" in articles of the forum, u can find some samples - also in VC CD (samples).
A nice hyper tool for optimizing your Microsoft html-help contents.
A best image tool for Windows C++ programmers, don't miss it!.
Includeh10
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have the below code:
There is a classs"CPaintDC".
Can anyone please tell me what is the difference between the following 2 statements:
1.)CPaintDC *pDC = new CPaintDC(this);
2.)CPaintDC* pDC=new CPaintDC;
|
|
|
|
|
1. calls the CPaintDC contructor which receives a CWnd* parameter, and initializes it with the this pointer passed,
2. calls the CPaintDC default constructor...
|
|
|
|
|
DC is related to Window, in other words, we say "a DC of a window".
1) the DC of "this" window - similar to ::GetDC(this->m_hWnd);
2) the DC of screen - similar to ::GetDC(0).
A special image tool for Windows C++ programmers, don't miss it!
A nice hyper tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Hi all
I have such question :
I often see following things in other people's code :
object.SomeFunction(BS_STYLE1 | BS_STYLE2 | BS_STYLE3)
and then after execution all those three styles are set to
the object .
How is this implemented inside the function ?
Can anybody clarify, or bring an example ?
thank you.
PS. For example this API uses such thing too :
ListView_SetExtendedListViewStyle(m_list, LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES );
|
|
|
|
|
Actually it is a DWORD in the function:
void ListView_SetExtendedListViewStyle(HWND hwndLV,DWORD dwExStyle);
And this one is:
#define LVS_EX_FULLROWSELECT 0x00000020
this is this.
|
|
|
|
|
thank you khan, but my question was how is it achieved inside the function that after writing
LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES
both styles are set.
And if I write only LVS_EX_FULLROWSELECT then only this style is set.
|
|
|
|
|
Actually it is just a parameter like any other. The actual code inside the function handles the values passed, which can be anything.
It maybe like:
void func(DWORD dwStyle)
{
m_dwStyle = dwStyle;
RedrawWindow();
}
//some draw function for the control:
void Draw()
{
if (m_dwStyle & LVS_EX_FULLROWSELECT)
{
}
else
{
}
}
this is this.
|
|
|
|
|
It's called BitWise. CP has loads of articles on it if you do a search, however this is[^] a particulary good one.
All the function is doing is something like:
void SomeFunction( DWORD dwFlags )
{
if( dwFlags & BS_STYLE2 )
{
DoSomething( );
}
}
Gavin Taylor
w: http://www.gavspace.com
|
|
|
|
|
i don't exactly get you ; however, if i understand well, you want to know this :
let go deeper in the instruction BS_STYLE1 | BS_STYLE3 | BS_STYLE6 .
firstly, we need to know what are defined those constants like.
let's consider they're declared this way :
enum {
BS_STYLE1 = 1,
BS_STYLE2 = 2,
BS_STYLE3 = 4,
BS_STYLE4 = 8,
BS_STYLE5 = 16,
BS_STYLE6 = 32
};
to understand why these constants' values are chosen, we must go in binary representation to understand :
1 -> 0b 00000000 00000000 00000000 00000001
2 -> 0b 00000000 00000000 00000000 00000010
4 -> 0b 00000000 00000000 00000000 00000100
8 -> 0b 00000000 00000000 00000000 00001000
16 -> 0b 00000000 00000000 00000000 00010000
32 -> 0b 00000000 00000000 00000000 00100000
notice that for those special values that are multiples of 2, only one bit is set at a time, all the others are equal to 0 .
the interrest in this is that each bit is a flag for a functionnality (style here), and we can mix them in once variable to avoid using as many booleans as we need flags.
for example, see the following case :
0b 00000000 00000000 00000000 00100101
Flags of <code>Style6</code>, <code>Style3</code> and <code>Style1</code> are set
now, as we don't handle binary directly in C++, we use bitwise operators instead.
what you see as that vertical bar | is the bitwise OR operator.
the OR operator works like this :
x y |
--------
0 0 0
0 1 1
1 0 1
1 1 1
in the case of the instruction BS_STYLE1 | BS_STYLE3 | BS_STYLE6 , it so OR s like this :
0b 00000000 00000000 00000000 00000001 <- BS_STYLE1
0b 00000000 00000000 00000000 00000100 <- BS_STYLE3
0b 00000000 00000000 00000000 00100000 <- BS_STYLE6
-----------------------------------------------
0b 00000000 00000000 00000000 00100101 <- BS_STYLE1 | BS_STYLE3 | BS_STYLE6
Now, the "mix value" is constructed, we can pass it to a function.
but how does the function know which bits are set, and which are not ?
easy... follow me !
Lets say we want to know if the bit of BS_STYLE1 is set from the mix we get in parameter (let's call it MIX_VAR.
we must create a maskwhich we'll AND with the :
STYLE1_MASK = 0b 00000000 00000000 00000000 00000001
as you see, the mask is the same as the STYLE constant, so in practice, you'll never see defined such mask :
MIX_VAR -> 0b 00000000 00000000 00000000 00100101
MASK1 -> 0b 00000000 00000000 00000000 00000001
----------------------------------------
<code>Bitwise AND</code> 0b 00000000 00000000 00000000 00000001
if the result is equal to the STYLE1, then it is because the bit was set. otherwise, you get 0 .
ok, now, in practice, here is how you'll often see it :
void fooFunc(DWORD dwMix) {
if (BS_STYLE1 & dwMix) == BS_STYLE1) {
}
else if (BS_STYLE2 & dwMix) == BS_STYLE2) {
}
else if (BS_STYLE3 & dwMix) == BS_STYLE3) {
}
}
wow, that's very long finally... hum, well, i hope it will help, truly !
|
|
|
|
|
Nice !
VuNic
|
|
|
|
|
Excellent explanation!
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
i think you should write an article on this thanks
|
|
|
|
|
ok, in the todo list
thanks
|
|
|
|
|
Thanks
modified 28-Sep-16 7:28am.
|
|
|
|
|
Have you tried posing this question here, or downloading the latest version from here? Do you have access to an SMTP server?
Oliver Shikaloski wrote: ...I can only send mails that are the same type like mine.
Do you mean in your same domain?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|