|
you could try one of these:
1. Invalidate only the Rect occupied by graph (from your code, i guess that the graph is not a separate control/window)
or
2. Extract the drawing code into separate function and call this function from OnPaint and from OnTimer
OnPaint()<br />
{<br />
CPaintDC dc(this);<br />
Draw(&dc);<br />
}<br />
<br />
OnTimer()<br />
{<br />
CClientDC dc(this);<br />
Draw(&dc)<br />
}<br />
<br />
Draw(CDC* pDC)<br />
{<br />
CRect rect (m_pt.x, m_pt.y, m_pt.x+WIDTH, m_pt.y+HEIGHT);<br />
pDC->Rectangle(rect);<br />
}
|
|
|
|
|
Both of your ideas seem like good solutions to me. I think I will try them both out and see which I prefer.
I feel a bit anoid with myself really for not thinking of the first one myself, it seems so obvious now you have pointed it out! Oh well, sometimes things just don't seem that obvious at the time - I'll blame it on it being Friday!
Thanks for the help,
Ali
|
|
|
|
|
Hello,
INTRODUCTION:
First of all forgive me for posting this question here as it's not related to VC++.
ENVIRONMENT:
Win2k or XP Pro.
I've created an app that must be started at the beggining and that must be stopped at the end so the user cannot switch to any other app.
The main problem was to keep it secure.
In order to do so, I've created a service that installs two system wide hooks (one that controls the keyboard and other that controls the mouse).
QUESTION:
I need to know how to avoid that the OS shows the user the phrase: "press F8 keyboard to show the start menu options" (Notice that I've translated it and I've done it from my memory (it's almost sure that the phrase is not the same but the meaning yes...)).
Thank you in advance.
|
|
|
|
|
Joan Murt wrote:
I've created an app that must be started at the beggining and that must be stopped at the end so the user cannot switch to any other app.
Basically a shell replacement? Just replace the shell with your program (some registry key somewhere), and don't allow that user to run Explorer.exe.
I need to know how to avoid that the OS shows the user the phrase: "press F8 keyboard to show the start menu options"
I'm not familiar with XP, but is it really the "OS" that displays this? It seems more logical that it would be just Explorer, and in that case it should be as easy as what I have suggested.
++luck;
|
|
|
|
|
first of all thank you for your answer...
Mike Nordell wrote:
it should be as easy as what I have suggested
I don't think that this can be an easy thing... and the fact that is the OS that shows that phrase seems clear...
I think that other versions of Windows made something similar but in Win2K Professional and XP Professional while the OS is being loaded and the first progress bar appears (not in graphical interface) under that progress bar can be read something about pressing the F8 key in order to show a safe startup menu.
I want to avoid that fact.
And, of course, it would be easy if the OS would be loaded and the system wide keyboard hook that I have installed could affect that, but as the OS is still not loaded it must be a flag/feature changeable somewhere in windows in order to avoid to show that.
Thank you in advance.
|
|
|
|
|
I would like to do something when mouse click on html page, have any good sample to show how to handle element events?
|
|
|
|
|
Why can't I use sizeof to find the size of a static data array within a class. It works fine if I use sizeof outside the class.
class myclass
{
public:
static char myarray[];
void myfunction()
{
// VC6 compile error: illegal sizeof operand
// GCC 3.2 'sizeof' applied to incomplete type 'char []'
// cout << sizeof (myarray);
}
};
char myclass::myarray[] = "this is a string";
int main(int argc, char* argv[])
{
myclass mc;
cout << sizeof(mc.myarray); // works
//mc.myfunction();
return 0;
}
another alternative I tried was to make the array const but this only works using GCC on linux; using VC6 I get errors.
class myclass2
{
public:
//VC6 error C2258: illegal pure syntax, must be '= 0'
//VC6 error C2252: 'myarray' : pure specifier can only be specified for functions
static const char myarray [] = "this is another string";
void myfunction()
{
cout << sizeof(myarray);
}
};
int main(int argc, char* argv[])
{
myclass2 mc2;
cout << sizeof(mc2.myarray); // works
mc2.myfunction();
return 0;
}
Thanks if anyone can help.
|
|
|
|
|
myarray must be defined before it is used as a parameter to sizeof, so you can't use it inside a class definition. compiler needs to see the definiton of the array to know its size.
Define the function in cpp file, after the myarray definition:
void myclass::myfunction()<br />
{<br />
cout << sizeof (myarray); <br />
};
|
|
|
|
|
|
In the SDI creat with Internet Explorer Style and a use HtmlView rather than CView? So on the left side, I created Tree (TreeView)?
How do I get the HtmlView to change the website, when I click different node in the tree? in short, How can CHtmlView get the treeview has changed message??
HELP
If there are three people walking with me, one of them can be my teacher.
[Andy]
|
|
|
|
|
When the selection in a treectrl changes it sends a TVN_SELCHANGED message. When you implement a WM_NOTIFY handler for that message in your treeview's message map, you can react on that event appropriately. In your case this could be calling the Navigate2 functon of your htmlview, passing the desired page.
|
|
|
|
|
you can detect leftclick and see if a item was selected.
|
|
|
|
|
I think what you need is to register you application to the registry.
--> check the registry section.
check on how to write system tray - there are some good one in cp.
If there are three people walking with me, one of them can be my teacher.
[Andy]
|
|
|
|
|
1
You can write the info about you app onto HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Runtype regedit on the Runand check it out??
NAME -- wirte your applicatoin name
Type -- REG_SZ
Data -- write the full path of your program..
2
http://www.codeproject.com/system/
go down to Registry and find out how to write and read....
http://www.codeproject.com/dialog/
use Find [Ctrl + F] on page, search for 'System Tray' or just 'Tray' you will find serveral Application that use System tray..
Hope it helops. (slow response due to slow internet speed.....)
If there are three people walking with me, one of them can be my teacher.
[Andy]
|
|
|
|
|
http://www.codeproject.com/system/windows_startup.asp - exactly answer ur question 1..
If there are three people walking with me, one of them can be my teacher.
[Andy]
|
|
|
|
|
Hi,
I need to count the hops between the source and the target machine ( like what the tracerout does ), can anyone tell me how it can be done ?
Ciao
- Nilesh
|
|
|
|
|
http://www.codeguru.com/network/tracert.html
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
Does anyone knows how we can retrieve the list of recently accessed documents programmatically
ie enumerate a list containing the file names from Start>Documents
The values are normally stored in the registry in binary format. Any easy way that we can use the information there and present it in CString format?
Thanks in advance, I am very new to all of this.
Effiniti->
|
|
|
|
|
Which OS are u on?
on disk :
C:\Documents and Settings\Papa\RECENT on win2k
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thanks.
I think I have found the solution by getting the special folder using CSIDL_RECENT and then reading the contents from that directory.
This seems to work. Any known issues with it?
Also if I wish to read REG_BINARY data from the Recent Docs entry in registry, any idea how I can do that?
Yhanks.
Effiniti->
|
|
|
|
|
(Obscure question of the month)
What fonts are installed by default with Chinese Windows 2000/XP and other east Asian Windows? (And I do mean the Windows shipped to those countries, not an English Windows using the Chinese, Japanese or Korean fonts.)
|
|
|
|
|
Have a gander at the following lines of code:
ofstream intrx;
ofstream intry;
intrx.open("intrx.dat", ios::out);
intry.open("intry.dat", ios::out);
unsigned int l = 0;
for (l = 0; l < m_nNumLines; l++);
{
for (unsigned int k = 0; k < m_nNumVerticies; k++)
{
intrx << setw(12) << m_ppdIntersectionX[l][k];
intry << setw(12) << m_ppdIntersectionY[l][k];
}
intrx << endl;
intry << endl;
}
intrx.close();
intry.close();
Looks innocent enough, yes? It seems there is a *weird* bug occuring here, specifically with the initialization of the loop index, 'l'.
When I trace through the code, I notice that 'l' gets initialized to '37' despite the fact that it is explicitly initialized as '0'.
If I have a look at the following:
&l (gives 37)
&l - 1 (gives 0)
It seems that the value of 'l' is being misplaced
Any help would be appreciated, I can't seem to figure this one out. The project compiles absolutely clean as well...
|
|
|
|
|
Errrrrrr, nevermind. I seem to have located it.
for (l = 0; l < m_nNumLines; l++);<---
^
I *AM* tired.
|
|
|
|
|
Turn onncompiler warnings and VC will flag that semicolon for you
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Do you perhaps call OpenClipboard without closing it?
|
|
|
|