如何将 64 位程序转换为 32 位程序

 时间:2026-02-15 15:57:14

C++ 编写的COM程序在被托管程序(C#) 调用时,会因为64位和32位不兼容的问题,不能被调用,需要转换。

那么如何实现 32/64位的互转换那? 答案是使用 VS tool 提供的 corflag.exe 程序。

工具/原料

VS 2010 及以后版本

方法/步骤

打开 VS Command Tool

Windows->Start -> VS -> VS xx Command Promot

输入 corflags.exe

输入 corflag.exe -? 获取帮助

Usage: Corflags.exe Assembly [options]

If no options are specified, the flags for the given image ar

Options:/ILONLY+ /ILONLY-       Sets/clears the ILONLY flag/32BITREQ+ /32BITREQ-   Sets/clears the bits indicating 32-bi/32BITPREF+ /32BITPREF- Sets/clears the bits indicating 32-bi/UpgradeCLRHeader       Upgrade the CLR Header to version 2.5/RevertCLRHeader        Revert the CLR Header to version 2.0/Force                  Force an assembly update even if the                        strong name signed.                        WARNING: Updating a strong name signe                         will require the assembly to be resi                         it will execute properly./nologo                 Prevents corflags from displaying log

输入转换命令

注意事项

管理员权限

  • 怎么把64位改成32位
  • bios一键还原系统不用u盘
  • 如何修改Windows系统权限为最高权限?
  • 如何在64位的系统中安装32位软件
  • 如何向Windows系统添加OEM信息?
  • 热门搜索
    拳皇大招怎么放 肥肠怎么洗 天然气表怎么偷气 脸冻伤了怎么办 文化程度怎么填 南方科技大学怎么样 东芝硬盘怎么样 开车撞死人怎么处理 榴莲怎么吃 金发科技怎么样