|
Look for implementing Custom DDV (Google for Custom DDV in MFC) (Like Dynamic Data Exchange(DDX), it is Dynamic Data Validation)
|
|
|
|
|
|
Hi everyone,
I need to use MagSetImageScalingCallback to capture the desktop screen. But I cannot find out how to call it correctly. I know it's odd, but do you have any idea about this deprecated function?
|
|
|
|
|
The documentation link that you provided has some lines in it that I would like to quote here -
Quote: Note The MagSetImageScalingCallback function is deprecated in Windows 7 and later, and should not be used in new applications. There is no alternate functionality.
Quote: This function requires Windows Display Driver Model (WDDM)-capable video cards.
Quote: This function works only when Desktop Window Manager (DWM) is off.
For screen capture, look at the following articles -
Various methods for capturing the screen[^]
Barry's Screen Capture[^]
Not sure if this is already mentioned in the articles, but I once captured the screen using the CreateDC API used this way -
HDC hdc = CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
You then save the device context in hdc to a file.
Read here for saving the device context -
Converting Device context to images ( PNG , JPEG , BMP , GIF) , Creating PDF & Printing to the Printer[^]
Saving (part of) a Device Context as a Bitmap[^]
|
|
|
|
|
Hi
When I first got my laptop last august my application that I was developing (at least the TCP/IP code)
was running fine about now my laptop runs a lot slower I tried to clean it up but it still doesn't
run nearly as fast it did when I bought it
towards that end on My CAsyncSocket::OnConnect overridble I am getting the following nErrorCode
WSAETIMEDOUT
I am wondering what is the best approach to this is modifying a registry key for the TCP/IP time out value (I am running Windows 7)
Maybe start clean re-install of Windows
Any suggestion appreciated
Thanks
|
|
|
|
|
Don't try solving a problem that may not exist. The first thing you need to do is investigate why the timeout is occurring.
Use the best guess
|
|
|
|
|
My computer has gotten a lot slower since I have gotten it
<a href="http://support.microsoft.com/kb/170359">http://support.microsoft.com/kb/170359</a>[<a href="http://support.microsoft.com/kb/170359" target="_blank" title="New Window">^</a>]
I tried Microsoft knowledge base 170359 to resolve the problem upping the time out times but didn't seem to work
I am thinking of re-installing windows to get the computer back to speed
|
|
|
|
|
does anyone have the source code of sudoku?, but that requires us to input numbers and and using C
|
|
|
|
|
yes, somebody probably does
|
|
|
|
|
Definitely.
Veni, vidi, vici.
|
|
|
|
|
Can anyone explain me why the following C++ snippet does compile and not end up in a compiler error ?
int main()
{
double d;
d = 0,2;
return 0;
}
I would expect the double assignment should be
double d;
d = 0.2;
Because I couldn't believe it, I tried VisualStudio 2010, -2005 AND -6, all three compiled with 0 errors, 0 warnings...
|
|
|
|
|
|
How simple can it be... Thank you Jochen.
And thanks to CppCheck for finding the mistake!
(see cppcheck.sourceforge.net)
|
|
|
|
|
'cos its built to handle the continental europeans, who use the comma for a decimal point....
==============================
Nothing to say.
|
|
|
|
|
Hi,
I have one function which is return string array in my C++ dll .from this function how can return error .please help me .
Thanks
|
|
|
|
|
venkatesh52867 wrote: how can return error
Use SetLastError() to set some unique error code, and return NULL instead of a valid pointer.
Use the best guess
|
|
|
|
|
In a dialog, WM_PAINT message handler, I set a timer.
void CXYZDlg::OnPaint()
{... SetTimer(12, 2500, NULL);}
in the OnTimer(),I found I have to set it again, then it goes into
the breakpoint in OnTimer() repeatedly. otherwise, it only goes into the OnTimer() function once.
<pre lang="c++">void CXYZ::OnTimer(UINT_PTR nIDEvent)
{
if (g_Scroll == 1) {
if ( sc< 16 ){
BuzzerOnce(1);
SC++;
}
else
sc = 1;
}
...
SetTimer(1361, 2500, NULL);
CDialog::OnTimer(nIDEvent);
}
modified 29-May-13 12:33pm.
|
|
|
|
|
Set the timer once in the dialog's OnInitDialog() method.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Thanks, but, it's like in the OnPaint();
|
|
|
|
|
Do you realize how many WM_PAINT messages a window handles? With few exceptions, that's not a good choice for turning a timer on.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I don't understand why you have to set the timer again because it will repeatedly called. If you want to handle multiple timers, you can call SetTimer() with multiple Id, for example
SetTimer(12, 2500, NULL);
SetTimer(1361, 2500, NULL);
Then in the OnTimer(UINT nIDEvent), you can process it as below:
if(nIDEvent == 12){
...
}
if(nIDEvent == 1361){
...
}
|
|
|
|
|
That means the timer will be set every time a WM_PAINT message is received. A very bad idea, since you have no control over it.
Use the best guess
|
|
|
|
|
Tried to put SetTimer() in OnInitDialog(), just trigger OnTimer() once, so weird.
But it is a old project wrote by others, I just tried to add a timer, to do something.
I wonder timer is a resource, like c++ "new" something, right? it will take up memory, if settimer repeatedly, no killertimer, then that means it will use more and more memory, right?
|
|
|
|
|
I have a new question about SetTimer(), if I use a unique ID, say,
SetTimer(2, 1000, NULL), then, I repeat this statement many times,
SetTimer(2, 1000, NULL),....
Then, I set one timer named 2 many times, or I set many timer with same name 2? that is, after 100 SetTimer(2,1000,NULL); there is only one Timer with name 2 in the system. or there are 100 pcs Timer with name 2 in the system?
|
|
|
|
|
In this case you are just resetting Timer2 with every call, but why do that - again it serves no purpose. Maybe it would be better if you actually explained what problem you are trying to solve.
Use the best guess
|
|
|
|