Writing a DLL For Use With rundll32.exe

不想你离开。 提交于 2019-12-13 21:23:04

问题


I have the following codes:

mydll.h:

#include <Windows.h>

__declspec(dllexport) void CALLBACK Entry(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow);

mydll.c:

#include "mydll.h"

void CALLBACK Entry(HWND hwnd, HINSTANCE hinst, LPSTR lpszCmdLine, int nCmdShow) {
    FILE *f;
    f = fopen("C:\\Users\\user\\Desktop\\test.txt", "rw");
    fprintf(f, "test");
    fclose(f);
}

It compiles to mydll.dll.

Then, when I try to do

rundll32.exe mydll.dll,Entry

It gives me the error message

Error in mydll.dll
Missing entry: Entry

What am I missing here?

来源:https://stackoverflow.com/questions/32506036/writing-a-dll-for-use-with-rundll32-exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!