cvt1101 can't open xxx.res for reading?

can't include more than about 510 .rc file in one mfc project. (there is a reason to include so many .rc in one project!)
after investigation (reverse engineering cvtres.exe), I fond the reason: cvtres will first open all the .rc files through fopen, and max file count can be opened by fopen are limited to 512 by default.
so, why would cvtres open all .rc file at the same time, not open one, read data, close it, and open another.
I think a file should be closed when no need to read it again. so, is this by design or it's just a bug?
can anyone shed any light on this?
I attach an IDA screen shot below.
it should work, but cvtres.exe is automatically excuted during the build process. I don't know how to manually execute cvtres, could you please give any tips? thanks in advance.
To work around the problem, try dividing the project into several projects (DLLs) that have a judicious number of resource files.
Or reconsider the "there is a reason to include so many .rc in one project!". Maybe the files can be merged.
Thanks, but we can't split project into small projects. so we choose the second solution : merge rcs.
but I still think cvtres.exe should close the file after reading it.
there is no reason just opening a file without closing it, right?
Sometimes a file is kept opened to make sure that it is not altered by other programs. Although, maybe this is not the reason in case of cvtres.
Thanks so much, I really hope future version of cvtres would close file to avoid this unexpected max open file limit.
or support an option or setting to be able to open more file. after investigation, I found the function _setmaxstdio
I think it's not hard to get the job done?
thanks again, really appreciate for your patient reply.
Sign in to comment