Search code examples
windows-7visual-studio-2005mc

Generating DLLs from an MC file?


I am taking over a bit of a legacy project, and having issues getting it to install in Windows 7.

The project is coded in VB, and our IDE for it is Visual Studio 2005 with VSS (fun I know). It was originally created for XP. The original dev is around to coordinate with, but is off the maintaince team for this project, and admits that the code is quite poorly formatted and commented it was his first large project.

The project runs fine when I generate a debug or release build in Visual Studio 2005, and I can run it on the Windows 7 machine that built it just fine. However, the MSI that I generate to install with fails when run on Windows 7.

It looks to be an issue where the DLLs that are packaged with the project are not correct for Windows 7, but they were generated via an MC file. I have the source MC files, so attempted to use MS's mc.exe tool and its counterparts to create the dll, but am not seeing any output.

The only walkthroughs I have seen on using MC files are not terribly helpful: mc_tutorial MS mc.exe page

Could someone else walk me through what steps are nessary, or point me toward some more helpful resources?

An actual high quality man page for mc.exe would be quite nice, instead of the rather limited MS documenation, but maybe I am spoiled these days.


Solution

    1. look for mc.exe in you machine (mc.exe is part of windows sdk usually located at C:\Program Files (x86)\Windows Kits\10\bin\10.0..\x64\mc.exe).
    2. in windows command prompt run : "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\mc.exe" -U sample.mc
    3. after above command run: "C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64\rc.exe" -r sample.rc
    4. above command will generate header in your sample.mc file location.
    5. run this command to generate dlls: link -dll -noentry -out:sample.dll sample.res