此问题已在此处有答案:
How to use Rundll32 to execute DLL Function?(1个答案)
7天前关闭
我有这样一个函数的定义:
__declspec(dllexport) int MyFunc(int param1, const char* param2)
whish只将参数写入文件:
WriteLog(std::to_string(param1));
std::string str_param2(param2);
WriteLog(str_param2);
我用这样的命令编译并运行dll:
rundll32 mydll.dll,MyFunc 1 blabla
当我打印我看到的值时:
4457714
MZђ
为什么会这样呢?
如何在param1中传递1?
1条答案
按热度按时间mbskvtky1#
解决方案是将函数声明为
并获得如下参数: