|
As far as I know, when you do a screen shot, you get what is on the screen. If part of your content is hidden by other windows, then you need to bring it to the front to take a screen shot. If it is too large for the screen and is partially hidden because it has scrolled, then you have a different problem.
Perhaps someone else has a better idea.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
|
Koma Wang wrote: Is there anyway ?
Yes, you can send the window the WM_PRINT[^] or WM_PRINTCLIENT[^] message and ask the win32k subsystem to paint into the device context you pass in the wParam. Not all windows support these messages (such as windows using DirectDraw) so your results may vary.
Best Wishes,
-David Delaune
|
|
|
|
|
Thanks !
I have a try soon.
|
|
|
|
|
Hi all,
i m using ListCtrl of Report View Type with checkbox property,
i want to identify when i click on ListCtrl its click on list item or checkbox.
i m using this code on NM_Click function
NMLISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
LVHITTESTINFO hitinfo;
hitinfo.pt = pNMListView->ptAction;
UINT uFlags;
int item = m_Err_List.HitTest(&hitinfo);
if(item != -1)
{
if (uFlags & LVHT_ONITEMSTATEICON)
{
AfxMessageBox("Click on checkbox");
}
}
here message display in both case whether i click on check box or on list item
please help me how can i do this.
thanks in advance
|
|
|
|
|
You have not initialised uFlags to any value so the test is based on whatever arbitrary value exists there.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
please tell me what value
|
|
|
|
|
Le@rner wrote: please tell me what value
I am not sure, what is it supposed to represent? Take a look at the documentation for the message you are decoding to see what values can be returned, and where they are in the message packet that is received in your code.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Try CListCtrl::HitTest[^] on for size...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Since the checkbox can only exist in the first column (item 0 ), check for that instead.
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
|
I am getting fault address error in my program. I am running the program in release mode and error is not coming constantly. When i check stack it shows adress 0x0000 or any other garbage address. I do not find any function name in call stack.
My program read data from a hard drive (asynchronously). After reading i process data. Sometimes error occured at address say 0x10000 or sometimes 0x20000. I can not reproduce error at same address and there is no hint for me how to detect error.
Is there any way to know where is the actual problem in my code.
|
|
|
|
|
The normal place to start is to try reproducing the error in a debug build running under a debugger.
Steve
|
|
|
|
|
|
I am using _wtof() to convert CString to double but I am not getting the actual double number code is below:
CString szStr;
szStr = _T("4.6");
double fVar = _wtof(szStr);
I am getting 4.599999999
How can I get 4.6 after conversion?
modified on Saturday, November 13, 2010 5:28 AM
|
|
|
|
|
|
Another poster already asked similar question already (http://www.codeproject.com/Messages/3644795/What-is-the-best-way-to-break-return-from-OpenMP-l.aspx[^]), but I'll ask anyway.
I have a function that checks if a point belongs to an object in array. The loop looks like this:
for (int i=0; i<N; i++)
{
if (point_is_in_object(obj[i], pt){
return true;
}
}
return false;
I parallelized it with OpenMP by adding shared boolean flag found .
bool found = false;
#pragma omp parallel for
for (int i=0; i<N; i++)
{
if (!found)
{
if (point_is_in_object(obj[i], pt){
found = true;
#pragma omp flush (found)
}
}
}
return found;
Is this a good way to do this? Could this cause access violation when one thread is writing and the other thread is reading memory contents of found flag?
I'm new to OpenMP and don't know much how it operates under the hood. With standard Win32 I would isolate access to found with critical section. Should I do the same here as well and add critical clause?
Thanks
|
|
|
|
|
Damir Valiulin wrote: Could this cause access violation when one thread is writing and the other thread is reading memory contents of found flag?
You are safe the memory barrier MFENCE[^] instruction will be generated by the flush directive. The only change I would suggest is declaring your bool as volatile. This will hint the compiler to generate instructions differently and not bother to keep your bool in a register.
Best Wishes,
-David Delaune
|
|
|
|
|
David, thanks for the quick answer. This was helpful.
|
|
|
|
|
hello guys...I have made a liberary module in VC 6. How can I use it in Visual C 2008?? thnx
|
|
|
|
|
you will probably need to re-build it in VS08
|
|
|
|
|
Hey folks, i was just wondering, what do you think which of these would generate a faster way -if there's a difference at all- to query a class variable:
class CMyClass
{
protected:
int m_myVar;
public:
int GetVar() const { return m_myVar; }
};
...
const int &GetVar() const { return m_myVar; }
...
,,,
inline int GetVar() const { return m_myVar; }
...
...
inline const int &GetVar() const { return m_myVar; }
...
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
In your example you are returning a basic datatype (an integer), then it's quite the same to return by reference or by value: for example on a 32 bit environment, returning by reference means load the address of m_myVar inside the eax register, while returning by value means load the content of m_myVar inside that register.
The inlined versions of your methods could potentially be better, because the compiler could better optimize the usage of CPU registers and produce a code a bit more efficient.
If your methods return a class or a struct the things could be different: returning by value means that your methods should allocate a temporary object on the stack and call its copy constructor. Then returning by reference in most of cases is better.
|
|
|
|
|
Of course with more complex types it's usually better to go by reference, i was just wondering about the basic types indeed. Thank you for your answer.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Leela: Fry, you're wasting your life sitting in front of that TV. You need to get out and see the real world.
Fry: But this is HDTV. It's got better resolution than the real world <
|
|
|
|
|
Actually in the long run, return by value may be shorter, but it depends on what you are measuring. For basic data types, the actual return doesn't make much difference, but then when you go to use the returned value, if it is returned by reference, there is an extra level of indirection to resolve.
Of course what the compiler optimizes out and what else you might do with the results enters into the overall performance, so it's not a simple matter to determine a priori. However, in most cases, I doubt the difference is major.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|