|
|
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]
|
|
|
|
|
Thanks everyone. And I modified the message a little...
|
|
|
|
|
oh, that's better now but the #include still don't appear. be carful to type & l t ; to see a < and a & g t ; for a > .
ok, now, you parser seem to be parser a little than one i wrote before. I cannot say to you what is wrong in your code, but I can give you an advice. see the source of my VisualCalc to perform your code...
If you need any question about your source, ask it to me here ; if it is about my code, post your request at the bottom of the VisualCalc article.
See you,
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I used the swab function to swap the data in a struct and then write it to a file. If I have two data structs that writes to one file, can I swap the bytes individually before writing them separately to the file or would I need to store them in a third struct (combo of the two), swap the bytes and then write to a file?
Scenario 1: read struct a, swap bytes, write to file
read struct b, swap bytes, write to file
Scenario 2: struct c is a combination of struct a and b
store struct a in struct c
store struct b in struct c
swap bytes in struct c
write to file
|
|
|
|
|
I don't know if this is the right forum, so bear with me. I'm pretty new, and I just need some help stopping the infinite loop that is occuring in my programming. The bit that is causing problems is pretty simple, but I can't figure out the problem! Here it is:
void Error_day()<br />
{<br />
int enter1;<br />
<br />
cout << "That is not a day!\n";<br />
cout << "Type 'C' then press 'enter' to continue...\n";<br />
cin >> enter1;<br />
<br />
get_info();<br />
}
Any help would be appreciated. Thanks
Only Neo is me, no Cleo can see, my future, if she did I'd shoot her!
|
|
|
|
|
You have to type in an integer to get rid off cin , or change enter1 from int to char to accept any character.
ARSALAN MALIK
|
|
|
|
|
if u want the ascii value.....go ahead and declare enter1 as int type but get it with functionz like getch() or getche(),or some function other than cin
if u want to use cin ,then declare the enter1 as char type
hope that helpz.....
happy programmin.....
cheerz.....
|
|
|
|