I need to repeatedly generate a Win32 DLL with a registration information function. This function uses literals to return customer specific registration information, with a separate DLL being built per customer.
I have a test version working correctly, with hard-coded information for one customer. The urgency for some sites dictates I generate some DLL's manually, but I would like to give the client an application that dynamically emits the C source and builds a DLL on demand.
What would be the the best way to do this? I have VS 2008 C++ Express, and thus the cl.exe compiler. My current approach would simply be to have a C# application with a string constant for the C source, and before generation, replace tokens in that with required parameters, then build and link by shelling out and running cl.exe. Is cl.exe freely distributable? How will you make sure the users of your software have a copy?
以上就是Programmatically generate a C Win32 DLL.的详细内容，更多请关注web前端其它相关文章！