| 发表于:2007-02-13 18:58:30 楼主 |
需要读一个1.2g的图像进行处理,原来用的new分配内存,总是out of memory,然后改用了内存映射,代码如下: handle hfile = createfile( szfilename, generic_read, file_share_read, null, create_always, file_attribute_normal, null); if(hfile==invalid_handle_value) { return null; } handle hfilemap = createfilemapping( hfile, null,page_writecopy, 0, 0, null); if(hfilemap==null) { return null; } pdata = (byte*)mapviewoffile( hfilemap, file_map_copy, 0, 0, (dword)(dwwidth*dwheight*4)); 还是不行,用getlasterror(),返回值是8,说是空间不够,请问高手们应该如何解决,等着干完回家过年啊!!谢谢了!!在线等~~~ |
|
|
|
|