|
hi..
i am making a grid..and i am doin it like this
for(int x = 10 ; x <= 2000 ; x += 10) {<br />
pDC->MoveTo(x, -10);<br />
pDC->LineTo(x, -1000);<br />
}<br />
<br />
for(int y = -10 ; y >= -1000 ; y -=10) {<br />
pDC->MoveTo(10, y);<br />
pDC->LineTo(2000, y);
the grid is fine...
i am uing a CScrollView and so when i scroll the whole thing blinks and looks bad...
so i want to use GetClipBox..
if i use it..can someone pls help me out as to how should i implement it in my above code???
CRect clipBoxRect;<br />
pDC->GetClipBox(&clipBoxRect);
for(int x = 10 ; x <= 2000 ; x += 10) {<br />
pDC->MoveTo(x, -10);<br />
pDC->LineTo(x, -1000);<br />
}<br />
<br />
for(int y = -10 ; y >= -1000 ; y -=10) {<br />
pDC->MoveTo(10, y);<br />
pDC->LineTo(2000, y);
i dont know how to incorporate the clipBoxRect with my code in order to make the blinking go away.
can someone pls help??
tks for your time..really appreciate it..
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
use a memory DC draw on that dc and then transfer to main dc
a CMemDC class it available everywhere
in scroll handlers don't call invalidate call updatewindow
|
|
|
|
|
MailMonty is right, you should use a Memory DC to avoid blinkcing (and also override OnEraseBkGnd)
However, CDC::GetClipBox is useful to limit the redrawing.
First, if GetClipBox returns NULLREGION, no need to continue, no part of the window needs refresh. Next, the rectangle returned by the method represents the area to refresh, so you can limit the drawing to this area only.
A quoi rêvent les personnes qui nous font vivre ce monde ?
|
|
|
|
|
hi..this is regarding the anwer you gave me in codeguru regarding getclip box...
i am new in MFC and wouldappreciate if you could tell me how do i use a memory DC draw on that dc and then transfer to main dc please???????
would really appreciate your help...
also, i dont know how to use a CMemDC class annd have never used it before...so i am very new in that too....i would really appreciate if you could help....
tks a lot...
you can mail me at extremedotnet@yahoo.com.sg
tks a lot....really appreciate it.
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
Joseph R. Thomas wrote:
codeguru
.... Heretic!
Joseph R. Thomas wrote:
i dont know how to use a CMemDC class annd have never used it before
Have a look to this article: http://www.codeproject.com/gdi/flickerfree.asp?target=CMemDC[^], it explains well how to avoid flickering with a memory DC.
HTH,
K.
A quoi rêvent les personnes qui nous font vivre ce monde ?
|
|
|
|
|
huh???
where did activeX come in???
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
Read the article more carefully: the author explains how to avoid flickering in MFC application and for MFC activex
A quoi rêvent les personnes qui nous font vivre ce monde ?
|
|
|
|
|
i am very new in MFC....i dont have any idea about how to make the screen dont blink....i dont know what is activeX...
i am stuggling with the screen...now the active X?????
is is something that helps with the screen???
is active X and MemDC related???
do i have top use ActiveX too???
Have a Super Blessed Day!
-------------------------
For God has not given us a spirit of fear, but of power and of love and of a sound mind.
2 Timothy 1:7
"For God so loved the world that He gave His only begotten Son, that whoever believes in Him should not perish but have everlasting life."
John 3:16
"Therefore you also be ready, for the Son of Man is coming at an hour you do not expet."
Luke 12:40
|
|
|
|
|
In the article, don't care about the section "Modifying a MFC Active X Control to use CMemDC", just read the section "Modifying an MFC Application to use CMemDC" and follow the steps described in this section. Just try it.
A quoi rêvent les personnes qui nous font vivre ce monde ?
|
|
|
|
|
Hi,
I have a module that performs configuration for a product. It uses access (via ADO) as its underlying db.
This module needs to start working remotely.
The most direct solution would be to access the remote database via a shared drive.
I am looking for alternatives (not excluding .net).
Any ideas?
Jeremy Pullicino
C++ Developer
Homepage
|
|
|
|
|
|
i created an SDI using formview. i wish to use half of the formview for visualization purposes, and the other half for placing dialog controls. how do i change the view size?
|
|
|
|
|
To change the default size of a Form view or scroll view, you can call:
SetScaleToFitSize(CSize(cx, cy));
I normally do this in the OnSize() to make sure I get no scrollbars after re-positioning all the controls in the view.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
thanx for replying. actually what i meant was how to set the visual view - white screen for drawing to half the window size so that i can place controls on the other half which is not on white blackground.
|
|
|
|
|
HI. I am new at socket but I have a question. Besides having alive or heartbeat msgs between the client and server, how else can the client for example know if the server is gone (say if a physical break in connection). Is there a call or something to almost like ping and make sure the other side on the socket I am using is OK?
Another question on similar lines. I I check to see if a socket connection is good every 5 sec. During that time, there is a physical break in connection and then reconnected before a check on the connection from the client etc. Will this mean that the connection is lost. A comparision is a telephone line versus something like a serial port. If a tel line is down, and you put it back, it is gone and you need to redial. If a serial port line is pulled out and then put back, it is still OK.
THanks!!
|
|
|
|
|
If you are using a CAsyncSocket then you can request a notification upon closure of a socket. If not, any read or write to a closed socket will indicate the same. Note that this is only a low level socket check to see if the TCP/IP stack on the remote computer is working - it doesnt tell you if the remote application is working, for which you'll need to implement your own 'ping' or timeout, if appropriate.
TCP will manage most of the temporary physical breaks in connections, and ensure that the connection remains valid - you dont need to worry about this. If it can't then the socket will be closed, which you can check for as above
|
|
|
|
|
How to write simple program for login password and each button can display function as help tool.........
|
|
|
|
|
"and each button can display function as help tool"
wat it means. give clear qns
Shanmuga Sundar.V
|
|
|
|
|
i mean that when the mouse pointer is point to that button it will come out message box which explain that button function example exit button is exit the program....
|
|
|
|
|
hi
I have an SDI with a few dialogs within for user interactions. I wish to know if it is possible for the doc class to gather data from the dialogs and then using the OnPaint() in view class to draw the graphics? I been having problems trying to connect the user input data to visual display. is there any way to directly code drawing in view class and then execute when after dialogs are accessed?
|
|
|
|
|
EDIT: I seem to have solved my problem using pointer pointers, but i'm not sure why or how without sitting down and thinking about it, someone care to shed some light still and get me started?
Someone explain why this isn't working please:
MyFunc(char* pBuf1, char* pBuf2, int nSize1, int& nSize2)
{
ASSERT(pBuf2==0);
pBuf2 = new char[SOMENUMBER];
}
However when I call this function like:
int nSize = 0;
char* pOut = NULL;
MyFunc(pOrg, pOut, 100, nSize);
delete[] pOut;
The code is straight forward, but when I step through it pOut doesn't retain the pointer to memory that is allocated inside the function? Inside the function everything is fine and a memory block is allocated, however once the function is complete and I continue with caller code the pointer to the allocated memory block remains ZERO???
What am I doing wrong...?
Thanks
The word of the day is legs, let's go back to my house and spread the word
|
|
|
|
|
Your problem is passing a pointer by value. You want to modify the pointer in the calling function so you have to pass the POINTER BY REFERENCE
change like this
MyFunc(char* pBuf1, char** ppBuf2, int nSize1, int& nSize2)
{
ASSERT(*ppBuf2==0); // Make sure caller hasn't allocated memory
*ppBuf2 = new char[SOMENUMBER];
// Fill previously allocated buffer with valid data
// ...
}
int nSize = 0; // Size of buffer allocated by functions belowchar
*pOut = NULL; // So function doesn't ASSERT
MyFunc(pOrg, &pOut, 100, nSize);
delete[] pOut; // Delete memory allocated by function
|
|
|
|
|
Hello
I have an app that plays a wav file to attract the users attention. The customer would like to have different sounds for different situations.
Rather than add a dialog box that allows the user to select a wav file I would like my application and its events to appear in the Sounds and Multimedia control panel applet and allow the user to select from the list of souns available.
I have found some settings in the registry under HKEY_CURRENT_USER\AppEvents\Schemees
that looks promising. Is it just a matter of figuring out what these are for and adding keys for my app or is there a set of API functions to do it.
Also, at runtime how do I ask windows to play the sound assosiated with this event?
If you could just point me to the general area in MSDN I should be right. I just cant find it
Thanks
Josh
|
|
|
|
|
You could find some info here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwue/html/ch11f.asp[^]
Basically, you have to create a registry key HKCU/AppEvents/EventLabels/<MyEvent> , with the default value set as a description. Then you have to associate this event with your application, by creating the registry key HKCU/AppEvents/Schemes/Apps/<MyApp>/<MyEvent>
To programmatically associate a sound file to this event for this application, create the registry key HKCU/AppEvents/Schemes/Apps/<MyApp>/<MyEvent>/.Current and set the default value to the path of the sound file.
To play it in your application, just call
sndPlaySound(_T("<MyEvent>"), SND_APPLICATION | SND_ALIAS | SND_SYNC | SND_NODEFAULT);
Or course, replace <MyApp> and <MyEvent> by your specific values.
HTH,
K.
A quoi rêvent les personnes qui nous font vivre ce monde ?
|
|
|
|
|
Briefly, how is the association between the executable and <myapp> made?
Steve S
|
|
|
|