CreateCompatibleBitMap Failing RRS feed

  • Question

  • Working Environment : - Native Code , Windows Mobile Professional 6.5.3

    In my application, I am creating a big compatible bitmap (DDB ) .The return value from CreateCompatibleBitMap is coming NULL. I know that this might be happening because there is No memory left in GWES.exe to assign to my Bitmap. 

    I want to know that wether after getting NULL value from the CreateCompatibleBitMap, can we call SHCloseapps to free any GDI resource ?(I will calculate the size of Bitmap requested as a parameter to the SHCloseApps)

    I am not sure whether SHCloseApps looks only at the available physical memory or it takes into account GDI resources occupied by applications also ?



    Thursday, June 24, 2010 12:14 PM

All replies

  • SHCloseApps() send WM_CLOSE mesage to other application to shutdown the application, if necessary. Once the application is closed it has to release all the allocated memory and resources. if you are in need of less memory it won't close the other application.
    Vinoth.R http://vinoth-vinothblog.blogspot.com http://www.e-consystems.com
    Thursday, June 24, 2010 1:09 PM
  • Hi Vinoth,


    My Query is that SHCloseApps take total Available physical memory as a point for killing apps or do it take GDI resource availability also into Considerations ?


    For e.g. it might be possible that physical Memory is available in plenty but there are no GDI resource available ( Not sure bit i feel that GDI resource allocation happens in GWES.exe in Windows mobile)  so that creating Compatible DC and Bitmaps fail. This thing is happening  in my case also. So i was trying to figure out a way to kill other apps when GDI resource allocation fails.


    Working Environment : - Native Code , Windows Mobile Professional 6.5.3



    Thursday, June 24, 2010 2:00 PM
  • CreateCompatibleBitMap use the your application's own virtual memory space rather than GWES.exe's, so I don't think you should worry about GWES.exe at all. Besides, SHCloseApps is OEM dependent, so one should not rely on its implementation details.
    Please mark the post that helps you, and unmark that does not. This benefits our community.
    Monday, June 28, 2010 10:27 AM
  • Each time I call CreateCompatibleBitMap size of GWES.exe increases while size of my Application remains same.
    Tuesday, June 29, 2010 6:01 AM