MSDNで同じ dll を呼び出しているこの例を見つけました
// ***
いくつかのガイダンスを提供するために、先頭にいくつかのヘルパー コメントを付けて注釈を付けました。
#include <windows.h>
#include <stdio.h>
#include <iostream>
typedef int (__cdecl *MYPROC)(LPWSTR);
int main( void )
{
HINSTANCE hinstLib;
MYPROC ProcAdd;
BOOL fFreeResult, fRunTimeLinkSuccess = FALSE;
// *** This loads the API DLL into you program
// Get a handle to the DLL module.
hinstLib = LoadLibrary(TEXT("D4000_usb.dll"));
// *** Now we check if it loaded ok - ie we should have a handle to it
// If the handle is valid, try to get the function address.
if (hinstLib != NULL)
{
// *** Now we try and get a handle to the function GetNumDev
ProcAdd = (MYPROC) GetProcAddress(hinstLib, "GetNumDev");
// *** Now we check if it that worked
// If the function address is valid, call the function.
if (NULL != ProcAdd)
{
fRunTimeLinkSuccess = TRUE;
// *** Now we call the function with a string parameter
(ProcAdd) (L"Message sent to the DLL function\n");
// *** this is where you need to check if the function call worked
// *** and this where you need to read the manual to see what it returns
}
// *** Now we unload the API dll
// Free the DLL module.
fFreeResult = FreeLibrary(hinstLib);
}
// *** Here is a message to check if the the previous bit worked
// If unable to call the DLL function, use an alternative.
if (! fRunTimeLinkSuccess)
printf("Message printed from executable\n");
return 0;
}