|
For dialog based MFC application, add PreTranslateMessage as virtual function from class menu.
ARSALAN MALIK
|
|
|
|
|
Oh, you got it all wrong.
What i meant was, which class's PreTranslateMessage() should i override, since PreTranslateMessage() is a virtual function in three classes.
Anyway, i have got the answer, we must override the CWnd class's function.
Thanx a lot for helping me out.
That was a real relief
/--------\
|AslFunky|
\--------/
|
|
|
|
|
maybe u dont get the keyz coz u have some other (control or) window on ut dialog box......
that can be the reason,have u tried SetFocus()???
hope that helpz.....
happy programmin.....
cheerz.....
|
|
|
|
|
Hi,
thanx for replying.
Yes, i have tried using SetFocus(), but that doesn't work.
Anyway, Arsalan Malik has given the right solution. We must override the virtual function PreTranslateMessage() of the CWnd class.
In this code we have to return a TRUE for the keydown messages if they are VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT. These are stored in the HIWORD and LOWORD of the message of the lpMsg paramater.
Please refer to MSDN if you cannot get this. It is quite clear there.
Thanx anyway.
Bye
/--------\
|AslFunky|
\--------/
|
|
|
|
|
hi,everyone.
i create a static library (mystalib.lib)which contains dialog resources,
and i use this library in an application, but i don't know how to use the dialogs in the library properly:
i specify the mystalib.res file in the project setting->link-> object/modules, and the complier reports a warning:
the mystalib.res already specifed,additional resource file ignored
but the result is that mystalib.res has been linked to the final executable ,and the resource of my application is igored,so my application can't start.
what's the reason for that , and how to link the mystalib.lib with my application properly?
Thanks.
|
|
|
|
|
Any body please tell whats the difference between keyword and reserved word
and also tell that if,else,while are keywords or reserved words
Please reply thanx
ihtesham
|
|
|
|
|
|
Hello.
Is it possible to know the place where cursor is placed in vscroll from WM_NCLBUTTONDOWN.
Thanks.
-Freehawk
|
|
|
|
|
2 solutions:
1. call GetCursorPos()in your WM_VSCROLL handler, you'll get the point in screen coordinate.
2. Inherit CScrollBar in MFC, handle messages involved some mouse actions within the new class. And then declare a control variable with type you just defined for your scroll.
|
|
|
|
|
Hello everyone:
I have a tree window, before scroll to the last line, I want to delete the tree and re-install it, and then scroll. For to do it, I want to get WM_VCSROLL before OnVScroll() is called.
1.I tryed to get the msg in PreTranslateMessage, but WM_VSCROLL is not sent into the function.
2.I tryed to get the msg in WinProc, but I cannot.
How to get it? Thank you.
-Freehawk
|
|
|
|
|
WinProc? You program in WIN32?
Did you mean DefWindowProc()?
Anyway, that's not important.
I guess this problem is because your message is sent to another window. Under the MFC framework, all messages would be sent to DefWindowProc( ) if their message handler are not defined (Ex: user defiend messages ). So your problem sounds quite strange...;P
( In Win32, you need to define all message handlers if you want to do something when these messages are sent. Otherwise, DefWindowProc( ) would be called. )
In addition, in Visual Studio you can use a tool Spy++ to "SPY" any message in your window.
I hope that will help. Good luck!;)
|
|
|
|
|
hi all,
I have created a exe using MFC. Now I want to execute it when starting the Windows...
If any one know that please reply me ..
Thanks in advance..
|
|
|
|
|
Just make a shortcut in the start>programs>startup
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
Add path (string value) of your exe to following location in registry:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
ARSALAN MALIK
|
|
|
|
|
Add path of your exe to following location in registry:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
Regards,
Vishal
|
|
|
|
|
Looking for code to create / control a color palette similar to Corel's color toolbar controls.
Thanks in advance
Tony Teveris
Gerber Scientific Products
Senior Software Engineer
Phone: 860 648 8151
Fax: 860 648 8214
83 Gerber Road West
South Windsor, CT 06074
|
|
|
|
|
|
How do I do exponents in C++? If ^ is XOR...
|
|
|
|
|
Use the pow() function.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
2^3= pow(2,3)
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
I wrote this string parser. It compiles without errors. But when I launch the program, it doesn't seem to quit the loop.... What's wrong?
#include <string.h>
int Parse(char *String)
{
int Temp = 0;
int Result = 0;
int Length = int(strlen(String));
bool Negative = false;
for (int i = 0; i < Length; i++)
{
if (i = 0)
{
if (String[i] == 45)
{
Negative = true;
}
}
else
{
if (String[i] < 48)
{
return 0;
}
else if (String[i] > 57)
{
return 0;
}
else
{
switch (String[i])
{
case 48:
Temp = 1;
for (int j = 0; j < (Length - i); j++)
{
Temp *= 10;
}
Result += Temp;
Temp = 0;
break;
case 49:
Temp = 1;
for (int j = 0; j < (Length - i); j++)
{
Temp *= 10;
}
Result += Temp;
Temp = 0;
break;
case 50:
Temp = 2;
for (int j = 0; j < (Length - i); j++)
{
Temp *= 10;
}
Result += Temp;
Temp = 0;
break;
case 51:
Temp = 3;
for (int j = 0; j < (Length - i); j++)
{
Temp *= 10;
}
Result += Temp;
Temp = 0;
break;
case 52:
Temp = 4;
for (int j = 0; j < (Length - i); j++)
{
Temp *= 10;
}
Result += Temp;
Temp = 0;
break;
case 53:
Temp = 5;
for (int j = 0; j < (Length - i); j++)
{
Temp *= 10;
}
Result += Temp;
Temp = 0;
break;
case 54:
Temp = 6;
for (int j = 0; j < (Length - i); j++)
{
Temp *= 10;
}
Result += Temp;
Temp = 0;
break;
case 55:
Temp = 7;
for (int j = 0; j < (Length - i); j++)
{
Temp *= 10;
}
Result += Temp;
Temp = 0;
break;
case 56:
Temp = 8;
for (int j = 0; j < (Length - i); j++)
{
Temp *= 10;
}
Result += Temp;
Temp = 0;
break;
case 57:
Temp = 9;
for (int j = 0; j < (Length - i); j++)
{
Temp *= 10;
}
Result += Temp;
Temp = 0;
break;
}
}
}
}
if (Negative == true)
{
Result = Result - (Result * 2);
}
return Result;
}
Any help would be appreciated...
|
|
|
|
|
just debug it, trace the variable value.
<italic>Work hard and a bit of luck is the key to success. You don`t need to be genius, to be rich.
|
|
|
|
|
[DFS] Zero wrote:
if (i = 0)
{
if(i == 0)
|
|
|
|
|
You may want to start and write defensively.
Instead of
if (i == 0)
Write
if (0 == i)
In this case you can not change the value of i by accident. It is so easy to leave out an equal sign.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
why not edit you message and put your code into a <pre></pre> block for helping us to see the indentation ?!
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|