|
Hi,
I am using mfc 9.0 for developing an application. I Created one SDI application with CScrollview as base class. i am having the Dialog box. once i clicked Add Dialog from the menu, then the Dialog box was loaded. i am having zooming options to zoom the Dialog as well as SDI Client area. The dialog box is zooming correctly if i am not scroll manually. Once i scroll manually, then the zooming for the Dialog box is not working correctly.
Please Help me..
|
|
|
|
|
This link may help.[^]
Regards,
Rane
|
|
|
|
|
How does the output vary for pre and post increment operators?
In this code, how and why does value of 'a' vary?
main()
{
int a=0;
printf("%d\n",a++);
printf("%d\n",++a);
}
OUTPUT:
0
2
main()
{
int a=0;
printf("%d %d\n",a++,++a);
}
OUTPUT:
1,1
|
|
|
|
|
main()
{
int a=0;
printf("%d\n",a++); // POST INCREMENT a is still 0
// HERE a is 1
printf("%d\n",++a); // PRE INCREMENT a is (1+1) = 2 now
}
main()
{
int a=0;
printf("%d %d\n",a++,++a); // Move from right to left
// ++a is pre increment so value for a is 1 for ++a. a++ is post increment so the value still remains 1 for a++
// Here a would be 2
}
Preincrement means the value is first operated upon and then used, while in post increment the value is first used then the change happens
Hope this helps
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
the developer shouldn't rely on the order of the parameters.
your inline printf() (the second example) is really bad.
On Visual C++, the parameters are unstacked from right to left, so when you do
printf("%d %d\n",a++,++a) ++a is evaluated before a++ .
this may be different on other compilers.
for how the value of a vary, you have to know how pre and post increment operators work.
Preincrement (++a) increments the variable and returns its new value (the value after the incrementation).
Postincrementation (a++) increments the variable ans returns its old value (the value before the incrementation).
|
|
|
|
|
i need to edpand the button to show following options
Import Traffic matrix
View and Export Traffic matrix
|
|
|
|
|
What do you mean ?
A button doesn't expand. it is clickable, and eventually can be shown as a checkbox/radio.
|
|
|
|
|
toxcct wrote: What do you mean ?
Probably he wants to show the popup menu on click of the button
toxcct wrote: A button doesn't expand. it is clickable, and eventually can be shown as a checkbox/radio.
But Why are you down voted for this??
Regards,
Sandip.
|
|
|
|
|
probably, and I thought of that too, but God, what if the OP doesn't specify it clearly ?
are we supposed to read in mind ?
So is my answer worth a 1 ?!
|
|
|
|
|
My guess would be that the OP wants to display the "Import Traffic matrix" text initially on the button. When the user clicks on the button he wants to display "View and Export Traffic matrix" on the same button, which obviously won't fit the initial size(something he sets depending on "Import Traffic matrix" at design time)
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
yes u are right
ok sorry i am new to MFC
|
|
|
|
|
Member 4655685 wrote: ok sorry i am new to MFC
that doesn't prevent you from writing a well written question explaining exactly what you want so we can understand your point and help you this way...
|
|
|
|
|
ok anyway do u know the answer?
|
|
|
|
|
|
Use MoveWindow to set the size of the button once the user has clicked on it and change the text. You need to check width so that the text fits in
m_btn.MoveWindow(10,10,300,40);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
I have a question as to when a preprocessor/macro constant should be used, and when a constant variable should be used.
Or it would be better if i put it in this way,
In a program,
when ONLY a macro constant MUST be used and not a constant variable?
when ONLY a constant variable MUST be used and not any macro constant?
|
|
|
|
|
Usually a constant variable is preferred (because it is typed).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
When using macros you should always remember that they're a direct text substitution, not something the compiler does. Imagine that before your source file is passed to the compiler a normal text manipulation program substitutes the macros with their values and this changed text of your source file is sent to the compiler.
One case when macros might be better than constants is when declaring arrays.
#define MAX_PATH 260
char arr[MAX_PATH]; always works, but
const int MAX_PATH=260;
char arr[MAX_PATH]; might give you problems on older compilers.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
There is no rule when to use constants or when to use preprocessors..
It is always better to use constants because it is typed.
|
|
|
|
|
I am not to able to enter the japanese and other language characters in my editbox control .
Please tell me what is the problem.
Thanx in advance
|
|
|
|
|
are you building in unicode ?
|
|
|
|
|
Initially i was building the project in debug and now in release. But the problem is same in both the modes.
Thanks
|
|
|
|
|
WTF !
I asked about UNICODE, not Debug nor Release mode
|
|
|
|