How to import a DLL function in C?

Мне дали DLL, которую я пытаюсь использовать. DLL содержит функцию «отправить». this is what I did:

#include <stdio.h>
#include <Windows.h>

int main(int argc, char * argv[])
{
    HMODULE libHandle;

    if ((libHandle = LoadLibrary(TEXT("SendSMS.dll"))) == NULL)
    {
        printf("load failed\n");
        return 1;
    }
    if (GetProcAddress(libHandle, "send") == NULL)
    {
        printf("GetProcAddress failed\n");
        printf("%d\n", GetLastError());
        return 1;
    }
    return 0;
}

GetProcAddress returns NULL, and the last error value is 127. (procedure was not found)

What am I doing wrong?

5
задан kennytm 29 August 2010 в 12:38
поделиться