During the process of coding/debugging my program, I sometimes fubar up my code enough that I seem to cause problems for DPLOT. When this happens I get a messagebox from DPLOTJR saying "In CopyBitmap, CreateCompatibleBitmap failed with width=973, height=733".
Now I don't know exactly how I cause this to happen, it seems to happen sometimes when I exit my program abruptly and then start it back up. Anyway that is all my problem. Unfortunately though, once this error message pops up, the only was I can get DPLOTJR to work again is to restart my machine. I've tried killing the DPLOTJR.EXE process, and restarting VB6. But it doesn't help.
Basically I am hoping to get some insight into why DPLOTJR reports this error, so that I may be able to track down what is happening on my side. Also if there is a command, or a method, I could use to reset DPLOTJR to work again, that would be nice to know about.
Any help would be appreciated,
xander
CreateCompatibleBitmap Failure
Moderator: DPlotAdmin
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
The error is unrelated to anything you've done with DPlot, it simply indicates that your system was unable to create a blank bitmap of those dimensions. That most likely indicates that you're severely low on memory, possibly (probably?) because you've already created (but not destroyed) too many graphic objects (in particular bitmaps).I get a messagebox from DPLOTJR saying "In CopyBitmap, CreateCompatibleBitmap failed with width=973, height=733".
If you're running into this problem after many calls to any of the functions that create/return a bitmap (DPlot_GetBitmap, DPlot_GetBitmapEx, DPlot_PlotBitmap, DPlot_PlotBitmap8), check to make sure that you're eventually deleting those bitmaps with DeleteObject.
Visualize Your Data
support@dplot.com
support@dplot.com
Ahh, thanks. I am using a timer to constantly display the bitmaps of a moving spectrum. I am using the DeleteObject before I draw the next one. But I am stopping my program at various breakpoints, so it may not get to delete the bitmap eveytime, thus by the end of the day I've used up too much memory.
I have been able to clear up the issue by killing my programs processes, and I would assume, as a result freeing up the memory the bitmaps were using. I'll have to keep an eye out to make sure I don't have a memory leak somewhere else, and that it is really is caused by my debug process. Anyway thanks again for the help. As always your support for this product is excellent.
I have been able to clear up the issue by killing my programs processes, and I would assume, as a result freeing up the memory the bitmaps were using. I'll have to keep an eye out to make sure I don't have a memory leak somewhere else, and that it is really is caused by my debug process. Anyway thanks again for the help. As always your support for this product is excellent.