0

我目前在访问 dll 文件中的方法时遇到问题。我试图访问的方法是类型。

int dstoch (float,float,float,float,float,float,float,float,float);

这是我正在使用的代码

typedef int (*LPMyfunct)(float,float,float,float,float,float,float,float,float);

HINSTANCE hDLL = NULL;
LPMyfunct lpdstoch;

hDLL = LoadLibrary("c:\\myfile.dll");

if(hDLL!=NULL)
{
    std::cout << "Library loaded \n";
    lpdstoch = (LPMyfunct)GetProcAddress((HMODULE)hDLL, "dstoch");

    int res = LPMyfunct(1,2,3,4,5,6,7,8,9); //this is where I am getting an error
}

编译时错误状态: a value of type LPMyfunct cannot be used to initialize an entity of type int

关于它为什么不接受 9 个参数的任何建议?

4

1 回答 1

4

替换LPMyfunctlpdstoch

于 2013-05-10T01:27:52.777 回答