|
Thanks for your efforts and time.
John M. Drescher wrote:
I made the minimize button hide the window instead of minimize and it fixed the problem
I think I will disable the minimize button. That should be enough.
John M. Drescher wrote:
As long as the application is not minimized it will not page out unless another process needs memory.
So what if another process does need memory? How can I delay all other processes and make them wait until I am finished?
Hosam Aly Mahmoud
|
|
|
|
|
Hosam Aly Mahmoud wrote:
So what if another process does need memory? How can I delay all other processes and make them wait until I am finished?
If another process needs memory it may affect the working set of your process. When all the physical memory of the system is exausted the cpu will trim the working set of all processes (other than the one requesting additional memory).
Hosam Aly Mahmoud wrote:
How can I delay all other processes and make them wait until I am finished?
Maybe setting the process priority to real time may solve your problem.
John
|
|
|
|
|
Thank you very much for your help John! I do not know how I could thank you, but here is a try:
John M. Drescher wrote:
Maybe setting the process priority to real time may solve your problem.
I thought it would, but I do not know how to do it. Could you please tell me (or give me a link)? I would very much appreciate it.
Thank you for all your help!
Hosam Aly Mahmoud
|
|
|
|
|
Not sure about how to tell how much RAM is free off the top of my head, but you can probably find out by looking at the memory management functions in MSDN.
Regarding locking allocated memory into physical memory, take a look at the VirtualLock() and VirtualUnlock() functions. These allow you to do exactly what you want.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Thank you for your reply. I am sorry, but I could not use VirtualLock() . I am still a beginner, so I do not understand what is meant by a "memory page". Second, do I have to use VirtualAlloc() or can I allocate using new ? What is the difference?
<marquee behavior="alternate">Hosam Aly Mahmoud
|
|
|
|
|
I would strongly suggest that if you don't understand what memory pages are and how they work, then you should just let windows handle the virtual memory. It is very easy to screw it up, and is not recommended while you're still trying to learn the basics.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Thank you for your reply. I would have let windows handle everything in normal situations, but I am currently working on a program that needs full processor power and enough RAM to use as a buffer. I had a problem with the buffer size though, so I thought it would be adequate to ask the system how much free RAM it has and then allocate most of it. I certainly need to make sure that my buffer does not go into virtual memory, because that would buffer something from the HDD to the HDD, right? That said, I want to learn the new concepts I neaded, so please give me a link or a hint where to find the information I need.
By the way, could you please tell me how to give my process higher priority?
Thank you very much.
<marquee behavior="alternate">Hosam Aly Mahmoud
|
|
|
|
|
I have no clue how big a buffer you are allocating but I just wanted to inform you for all practical purposes on a 32 bit version of Windows that is not advanced server or greater you can not allocate a buffer greater than about 1.2GB because of several reasons that have to do with how process memory is partitioned.
John
|
|
|
|
|
Thank you for the information.
<marquee behavior="alternate">Hosam Aly Mahmoud
|
|
|
|
|
Here is a good tutorial about Memory Management, it’s a little old and mentions 16 bit windows and RISC stuff that you should not be very concerned with:
http://www.jps.at/dev/kurs/3-2.html[^]
John
|
|
|
|
|
In the dialog box, there are 3 edit boxes. After the dialog box initialized, the first edit box is highlighted and also have focus. What I want to do is when the first edit box is not empty, set it as ready only and also set the focus to the second dialog box.
I tried
GetDlgItem(IDC_EDIT2)->SetFocus(); Not working
Also tried
CEdit *pEdit =(CEdit*)GetDlgItem(IDC_EDIT2);
pEdit->SetFocus();
still not working.
Please help me with this problem.
|
|
|
|
|
You can get into race conditions using SetFocus() in a dialog. Use PostMessage( WM_SETFOCUS,.. ) instead.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
This is the way:
In menu "Layout",you may find "Tab Order"! click it and the dialog edit will show 1,2,3,4.....,that is the focus order,change the order by click controls,you can set the focus to the second dialog ,good luck !
sorry for my language!
|
|
|
|
|
I am experiencing a very strange problem.
When my MFC app is run, all of the Tool Tips in our program, as well as all Windows Tool Tips show the tip of the *last* tool that was hovered over. Here is what happens upon program launch.
* The first toolbar button that I hover over doesn't get drawn. Actually, it's shadow gets drawn, but the tip itself doesn't draw.
* The next toolbar button that I hover over gets drawn with the text of the first button that I hovered over.
* The width of the Tool Tip is wide enough for the text of the "correct" text, not the width of the "incorrect" text which is being displayed.
* This goes on and on until you hover off of a button onto some dead space, and then hover over it again, in which case, it will show the correct tip, but goes wacky again once you hover over another button.
* All Tool Tips on the system get screwed up like this until the app is shut down.
Thus, there seems to be a "lag" or mismatch bewteen what is being displayed and what the correct tip should be.
To try and get to the bottom of this problem, I have commented out all Tool Tip related code from my app, including Tool Tip flags passed to controls such as Tree controls, etc.
I have also tried commenting out any other "non-standard" things that I am doing. All of my users are experiencing this. I have tried creating a new blank app using AppWizard, but could not duplicate the problem.
Does anyone know what this might be related to, or what I might have done wrong to screw things up? If not, does anyone have any info on how to debug something like this, or where I can even trace/step through the code to find out what is going wrong and where.
Thanks
Dario
|
|
|
|
|
How can I display text next to the toolbar button when the mouse is on top of it? By default, text entered at the Prompt field is displayed at the Status bar. It is not user-friendly since the user will have to look at the buttom of the screen to see the text.
Eilzabeth
|
|
|
|
|
I just figured it out myself. At the Prompt field of the Toolbar resouce editor, I added the string "\n", for example, "System Users\nUsers".
Eilzabeth
|
|
|
|
|
Some body please help me to make a 3 bitmap button on a dialog box
buttons like A,b,C ...if 'A' is pressed from key board
button A will be depressed, if 'b' is depressed from key
board, button b will be depressed.
Can any one do it and help me! really ??
|
|
|
|
|
You can find out how to make the three buttons with bitmaps on them here on the code project. The MSDN library also has information on this topic. Once you are done with the buttons, you should have a function associated with each button.
From there you have to listen for keyboard events. Should a key you are interested in be pressed, you just call the function for the proper button you want to press.
Lorenz Prem
Microsoft Corporation
|
|
|
|
|
I have problem with CTime in DoDataExchange() function
None of 15 overrides in funkcion takes CTime as an parameter
When I convert it using CTime aTime.Format("%d.%m.%Y") then
I'm able to transfer data from ODBC database into my Edit control
but when I try to Update database then it throws exception.
Can somebody help me with right way of doing this.
Thank You
|
|
|
|
|
i have none about direct-x or open-gl.
my Q is: could any of them capture screen (or any window)?
if so, i will learn.
thx for any suggestions.
includeh10
|
|
|
|
|
To clarify your question: Are you trying to create an app that captures standard Windows desktop windows or specifically a DirectX/OpenGL app?
- Mike
|
|
|
|
|
use directx or open-gl to capture screen or windows, normal method is too slow.
includeh10
|
|
|
|
|
Hi,
I would like to be able to send a file (.doc) throught internet with a client/server App. I will probably use MFC & CSocket to code the App.
Microsoft documentation tell us that we can send ordinary data (int, double, CString , serializable class etc..) using serialization into CSocket. But what if I want to send a file unstead of data.
Is there a way to achieve this?
thanks a lot
Mykel
Everything's beautiful if you look at it long enough...
|
|
|
|
|
an easy way would be to read the contents of a file into a buffer and then send the buffer over the net. If the files are big, you can read the files in chunks - and send each chunk over the net and reassemble them on the other side.
--
Ich, du, sie, er, es, ihr, sie, Sie.
|
|
|
|
|
Check out MSDN for Simple MAPI, or you could use PJ Naughter's CSMTPConnection which here on CP. Do a search.
Sonork 100.11743 Chicken Little
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
Within you lies the power for good - Use it!
|
|
|
|