我在调用一个动态链接库,可是程序一运行变出现一个错误:“无法定位程序输入点open_terminal于动态链接库MC8003D.DLL上”
open_terminal:是函数名
MC8003D.DLL:是要使用的动态链接库

解决方案 »

  1.   

    void __fastcall TForm1::FormCreate(TObject *Sender)
    {        //int dll
            Mc8003dll = NULL;
            Mc8003dll = LoadLibrary("mc8003d.dll");
            if(Mc8003dll == NULL)
                    Mc8003dll = LoadLibrary("mc8003.dll");
            if(Mc8003dll == NULL)
                    ShowMessage("Cannot load MC8003 dll"); 
            build_terminal_channel = (int(__stdcall*)(unsigned char *))( GetProcAddress(Mc8003dll, "build_terminal_channel"));
            open_terminal = (int(__stdcall*)(int, unsigned short))( GetProcAddress(Mc8003dll, "open_terminal"));
            close_terminal = (int(__stdcall*)(int, unsigned short))( GetProcAddress(Mc8003dll, "close_terminal"));
            recv_data = (int(__stdcall*)(int, unsigned char * ,int, unsigned short *))( GetProcAddress(Mc8003dll, "recv_data"));
            get_more_data = (int(__stdcall*)(int, unsigned char * ,int, unsigned short *))( GetProcAddress(Mc8003dll, "get_more_data"));
            send_data = (int(__stdcall*)(int, unsigned char * ,int, unsigned short))( GetProcAddress(Mc8003dll, "send_data"));
            close_terminal_channel = (int(__stdcall*)(int))( GetProcAddress(Mc8003dll, "close_terminal_channel"));这个是BC的程序,不知道delphi怎么做?