As said already before. You are using the API of GlobalMemoryStatusEx wrong. Please initialize *after* memset-ing the MEMORYSTATUSEX structure its dwLength member by sizeof (MEMORYSTATUSEX).
Your sample doesn't build correct (some none-present types, some typos, etc). So I reduce the shown solution to the lines of availableRAM function: 2013/11/17 Jim Michaels <jmich...@yahoo.com>: > addressType availableRAM(void) { > memset(&mse,0, sizeof(MEMORYSTATUSEX)); mse.dwLength = sizeof (MEMORYSTATUSEX); > if (0==GlobalMemoryStatusEx(&mse)) { > std::cout<<"GlobalMemoryStatusEx():ERROR\n"; > return 0; > } > addressType ram=mse.ullAvailPhys; > std::cout<<"availableRam()="<<ram<<"\n"; > return ram; //do I need to use a percentage here? is there a structure > overhead with bitset? > } Kai ------------------------------------------------------------------------------ DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk _______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public