|
Hi friends,
I need to make a transparent control over Mobile screen.
Eg: Some video is displaying on mobile and my transparent control can be seen on that screen.
Could anybody tell me how to achieve that ??
|
|
|
|
|
How to determine actual virtual memory used for a process using mfc
|
|
|
|
|
Adopt the similar strategy as posted by me below!
Regards,
Rane
|
|
|
|
|
Do you need to SetProcessWorkingSetSize ?
|
|
|
|
|
|
How to determine actual memory used for a process
|
|
|
|
|
Use OpenProcess() to get a handle to the process that you want to monitor.Then use CreateToolhelp32Snapshot() API which will give you lists of the modules (DLLs) that are a part of your process image which you can then iterate using Module32First/Module32Next() and obtain the load addresses and extents.
It will also give you a list of the heaps, runtime allocated memory used by alloc/free and stacks. You then use Heap32ListFirst/Heap32ListNext to iterate those and obtain their start addresses and extents. You then use those addresses with ReadProcessMemory() to actually read the Random Access Memory.
Also, be sure to suspend the target process otherwise things could change the moment after you obtain your information.
Regards,
Rane
|
|
|
|
|
For example,
there are two edit mode, one is for drawing a rect, the other is for dragging a rect.
And I might write both in one message handler (eg. OnMouseMove).
It become less clear when there are more edit modes.
Any way to solve this problem?
system
|
|
|
|
|
Why don't you have a flag, identifying the mode in which you are. That would make your code clear.
- Malli...!
|
|
|
|
|
A flag brings many condition compare, like message handleing when do Windows API programming.
One mode introduce an extra if-else or switch-case ,
what about 10 modes?
system
|
|
|
|
|
You wanna to write all the handlers in a single functions. If that is the case I hope you have to have the switch-case/if-else in your program. The only thing you can reduce is the number of flags. Define the enum data type for your modes, rather having different flags. I suggested flags just because you had specified only two modes. But having the 'enum'ed your modes doesn't skip the conditional programming part in your message handler.
- Malli...!
|
|
|
|
|
It's a photo processing application with 10 more edit modes.
I saw a solution for this problem serveral years ago, but can't find it now.
system
|
|
|
|
|
what kind of solution was that exactly ?
- Malli...!
|
|
|
|
|
|
I use an enumeration.
The if/else or switch code to check the mode is insignificant
relative to the slowness of mouse messages...there's no performance
issues on a modern PC if that's what you're worried about.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm not worried about performance.
I don't want the message handler like a native window proc funciton.
(a big switch)
system
modified on Friday, September 19, 2008 8:34 PM
|
|
|
|
|
My project is SDI that first view is CFromView derive class.
Then I add second view with CScrollView derive class.
In this view I want to print out the data but I don't know how to do that.
Please advise me how can I do.
|
|
|
|
|
Try to associate your 2nd view with the doc at first,
It it very likely to solve the problem.
If your demand is very specific,
try to handle the print message in CView2 by yourself,
you may call CView2::OnDraw in the print handler.
system
modified on Friday, September 19, 2008 5:34 AM
|
|
|
|
|
I copied the Manifest example from the MSDN site, and included it as an XML resource in my code, to represent generic elevated rights. Now, my rc compiler is old, and knows Nothing about XML, but my Linker knows about '.res' files.
Would anyone be willing to compile a Generic Manifest into an rc File for me, so that I can include it in my code.
Anyone willing to assist may contact me at:
bramvankampen@aol.com
Regards,
Bram van Kampen
|
|
|
|
|
Hi all,
Whats the difference between these:
Multi-threaded Debug (/MTd)
Multi-threaded (/MT)
Multi-threaded DLL (/MD)
Multi-threaded Debug DLL (/MDd)
I am currently using
Multi-threaded Debug (/MTd) in my project because I encountered an mfc error message when I used Multi-threaded Debug DLL (/MDd). Please Advise because I haven't seen how it affects my project.
Thanks,
Jayjay
|
|
|
|
|
|
So, I'm trying to track down a bug in an activeX control I'm working on. I'm supposed to be centering text, the text is no where to be seen. Hmm, should be able to find this pretty quick. So, I set a breakpoint at the start of the offending method, walk through the code, all looks well. I hit go, and all is drawn correctly. Hmmm, so I leave the breakpoint off, and now it draws incorrectly.
Then it dawns on me - hit a breakpoint and things draw correctly.
I know debuggers help sometimes by initializing data in debug mode. I've never heard of one doing things when a breakpoint is reached. Any ideas?
Charlie Gilley
Will program for food...
<italic>Hurtling toward a government of the stupid, by the stupid, for the stupid we go. —Michelle Malkin
|
|
|
|
|
charlieg wrote: debuggers help sometimes by initializing data in debug mode.
I don't think debuggers change your data, but debug libraries
may initialize data.
If a breakpoint/run sequence makes something draw correctly, often
it's just a case where you needed to invalidate the window and/or
call UpdateWindow().
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
Oh I wish it were so simple as an invalidate. I have had debuggers help me in the past, but this issue just gets weirder.
At this point, I have OnSize, OnPaint and OnDraw. They all call GetClientRect to determine what needs to be drawn. Only OnSize tracks correctly. So, I have something seriously wrong in the control, perhaps a misunderstanding between me, the control and it's container.
cg
|
|
|
|
|
I have some code originally developed in VS6. The boss wants it to run under VS2005, and I found some problems with atof(buffer).
Buffer is read from an ASCII file, and in VS6 everything goes fine, but in VS2005 its messed up:
buffer is "409600.0000"
in watch window atof(buffer) shows value of 409600.00000000
BUT when I assign to a double variable:
DOUBLE variable = atof(buffer) I get 101523136.0000000
Any help fixing this would be appreciated.
|
|
|
|