|
PowerBASIC Forums
![]() PowerBASIC for Windows
![]() Bitmaps Used In Menu's?
|
| next newest topic | next oldest topic |
| Author | Topic: Bitmaps Used In Menu's? |
|
Clay Clear Member |
Three days ago, I started getting this weird Windows aberration where, if Windows is run for 5 or more hours continuously, and I then try to run a Windows program, I get an error message (to paraphrase) that states "...not enough free memory to run this program..." When this has happened, I've checked my memory status icon in the My OS is Win98SE, and I have NEVER had a problem of this nature The only changes I can coherently recall that were made three So, about 8 hours ago, I uninstalled the new video drivers, and So, my actual question: can the custom checked/unchecked bitmaps If the answer to the question is in the affirmative, where in my The three programs use hidden, MODELESS dialogs which exist I have gone back to using %NULL for the bitmap handles used by While waiting for the results, any answers to this posting would Thanks in advance! ------------------ Clay Clear's Software (Frames Only) IP: Logged |
|
Michael Mattias Member |
Known problem with Win/9x. O/S does not return deallocated memory to system pool correctly. When total system allocations during "up time" reach 2Gb, you are 'out of memory.' Fix? Re-boot. (Or go to NT or Win/2000, which do not have this problem). MCM IP: Logged |
|
Clay Clear Member |
Michael, Thanks for your prompt reply. Can you, or anybody else, give me a more detailed answer as to Thanks! Regards, ------------------ Clay Clear's Software (Frames Only) IP: Logged |
|
Clay Clear Member |
ADDENDUM: I just recalled that one of my tray programs DOES update one of its menu items every 10 seconds, when the TIMER fires. And, that particular menu item does use my custom bitmaps for its check states. It's not a critical timer operation - it just automates updating the menu item based on the presence of a Registry value and a certain directory. I'll disable the timer, and try it. I'll also restore the custom bitmaps to the other two tray programs, which ONLY update the bitmaps when I select them. But, now I've got to wait ANOTHER 5-6 hours to see the result of these tests <sigh> But, this leads to another question - if my Windows error is being The same program that refreshes its menu item every ten seconds used the Thanks in advance! ------------------ Clay Clear's Software (Frames Only) IP: Logged |
|
Brad D Byrne Member |
Clay, Just curious? Are your custom bitmaps DIB's or DDB's?-----B ------------------ IP: Logged |
|
Clay Clear Member |
I have LoadImage load them as DIB's (%LR_CREATEDIBSECTION). I don't know offhand how my registered Photo Icons 2001 converts them, though. The original bitmaps were JPG's, created with ImageViwer/32. I used Photo Icons 2001 to convert them to BMP's.
Clay Clear's Software (Frames Only) [This message has been edited by Clay Clear (edited December 01, 2001).] IP: Logged |
|
Michael Mattias Member |
If you think it is your program which is doing all the allocations, you CAN get around that. I have a program which has the problem: I only need 2 or 3 Mb of memory at any one time, but I need it fairly often. What I did was this (and I think I posted this before, but darned if I can remember where): At the start of the program, I create private heap with a size of 20Mb (your size is, of course, whatever you need). Whenever my program needs to allocate these chunks of memory, I use HeapAlloc/HeapFree from that private heap. It seems that while CreateHeap counts against your "total" of 2.1Gb, HeapAlloc/HeapFree do not; that is, memory allocated from a private heap is returned to the heap pool correctly, and it only costs you the value of the HeapCreate memory in terms of system usage. Note that the PowerBASIC DIM/REDIM (array) are allocations, too; if you need to create lots of local arrays, your best bet is to allocate as above, then use DIM AT... the pointer returned by HeapAlloc. (This is actually how I came upon this Win 9x problem and solution). MCM IP: Logged |
|
Clay Clear Member |
My Windows just aberrated again, this time after about 4 hours. This is AFTER I had restored the three programs to the state they were in before I modified them to use my custom BMP's. They ran successfully in those states for 3-4 months, during which I never had this particular Windows problem. So am now convinced that my problem has been caused by shoddily Am going to reformat my HD and reinstall everything. I don't know At any rate, MANY thanks to the people who replied to my original Michael, While the message you posted about the Heap functions may not be ------------------ Clay Clear's Software (Frames Only) IP: Logged |
|
Lance Edmonds Member |
Clay, if you use the Resource Meter app (that comes with Windows), what is happening to the free system resources leading up to the "low memory" condition? ie, if GDI resources are dropping, chances are it is your app(s) that are the problem. ------------------ IP: Logged |
|
Clay Clear Member |
Lance, Thanks for your reply. It never even occurred to me to use the I have gotten far enough in my HD reinstallation to set the Meter It's also occurred to me that I might have a DIMM that's slowly At any rate, I'll be back in a few hours to post any observations Thanks again! ------------------ Clay Clear's Software (Frames Only) IP: Logged |
|
Clay Clear Member |
Ummmm, Lance, got a question for you, which I hope you answer SOON, so I can move on to other endeavors, based on your reply: how long would you expect that I'd have to monitor the Reource Meter before seeing changes, *IF* it's my programs that are causing the resource losses (if the problem is indeed that)? I've been checking it every 3 mins. for the past 30-40 mins., and the ONLY changes I observed in it were when I ran MSIE to logon to here. Before I did that, the Meter display held steady at: System: 90% User: 90% GDI: 99% If my programs were causing GDI resources drops, wouldn't it seem
Regards, ------------------ Clay Clear's Software (Frames Only) IP: Logged |
|
Lance Edmonds Member |
Possibly - it completely depends on what the apps are doing... ie, you msy not have a problem until they start "working" - in idle state they may be content not to chew any resouces. Anyway, this is just an idea to see if resources are a problem. It could just be a flaky install, and it could be some other app or service you have running. In my experience, low memory conditions are rarely caused by Video drivers unless they are one of those recent "shared-memory" models - those work by using main DRAM as part of the video memory instead of relying on their own memory, and are hence cheaper/nastier than a "proper" card. I've also seen everything from IE to Windows itself consume a whole heap of memory for no "obvious" reason. That is, I think you need to move to a 2-pronged attack:
This may help you pin it down, assuming it to be your app that is the problem. After all, in the past 3 days, there have been a tremenous amount of Viruses sent around and you have no alluded to whether you have AV running... one of the symptoms of the BADTRANS virus is O/S instability. And to be honest, the number of forum users that have emailed me viruses in the past few days is staggering. Some of you will have received my "note" by now and you will know who you are... ------------------ IP: Logged |
|
Clay Clear Member |
Lance, Thanks for replying promptly. I won't bug you or anybody else The thought of a virus attack had occurred to me also, but I had One thing that I found out since posting my last message to you, which I "...for best multimedia applications and games functioning..." <- is a complete rephrase, but the general idea is there Well, when I installed the updated video drivers 3 days ago, I was running At any rate, I apologize for this windy posting...will cut it off at Thanks again for your valuable assistance! ------------------ Clay Clear's Software (Frames Only) IP: Logged |
|
Charles Dietz Member |
Clay, If the problem persists after reinstalling your OS, you might try running msconfig to remove all programs running in the background, and then add them back in, a few at a time, until the offending one can be isolated. Just a thought. And if you suspect the ATI video drivers, maybe you could change the drivers to 'Standard VGA' supplied with Windows. Of course you will have only 640 x 480 resolution and 16 colors, but this would at least test if the problem is caused by the ATI drivers. Just another thought. [This message has been edited by Charles Dietz (edited December 02, 2001).] IP: Logged |
All times are EasternTime (US) | next newest topic | next oldest topic |
![]() |
|
Copyright © 1999-2007 PowerBASIC, Inc. All Rights Reserved.