无忌大哥,谢谢你的翻译,但是我的问题不是函数规则的问题。程序编译我没有语法错误,所以证明我的程序是对的,但是编译后的程序不能被连接成一个EXE文件,提示如下的错误。我不知道如何解决。<br>[Linker Error] Unresolved external 'as200_vs_field_read' referenced from D:/程序/TEST/UNIT1.OBJ<br>经过昨天一下午的加班,问题我已经解决。我是直接调用w95_s7m.dll来实现的。下面我将我的BC的例子程序贴出来,请大家指点。<br> int buffer[100];<br> ZeroMemory(buffer,sizeof(buffer));<br> int dbno,dwno,anzahl;<br> int error;<br> dbno=10;<br> dwno=4;<br> anzahl=45;<br> adr_table_type plc_adr_table[2]={{2,0,2,0},{0,0,2,0}};<br><br> String tempstr="";<br> TApplication *app=Application;<br> int (__stdcall *as200_vs_field_read)(int,int,void*);<br> int (__stdcall *load_tool)(char,char *,adr_table_type *);<br> int (__stdcall *unload_tool)(void);<br><br> HINSTANCE DLLInst=NULL;<br> DLLInst=LoadLibrary("w95_s7m.dll");<br> if(DLLInst)<br> {<br> load_tool=(int(__stdcall*)(char,char *,adr_table_type *))GetProcAddress(DLLInst,"load_tool");<br> as200_vs_field_read=(int(__stdcall*)(int,int,void*))GetProcAddress(DLLInst,"as200_vs_field_read");<br> unload_tool=(int(__stdcall*)(void))GetProcAddress(DLLInst,"unload_tool");<br> if(load_tool)<br> {<br> error=load_tool(1,"S7ONLINE",plc_adr_table);<br> }<br> if(as200_vs_field_read)<br> {<br> error=as200_vs_field_read(dwno,anzahl,buffer);<br> }<br> if(unload_tool)<br> {<br> error=unload_tool();<br> }<br> FreeLibrary(DLLInst);<br> DLLInst=NULL;<br> if(!unload_tool||!as200_vs_field_read||!load_tool)<br> {<br> MessageBox(Application->Handle,"未找到函数地址。","错误",MB_ICONERROR+MB_OK);<br> }<br><br> }<br> else<br> {<br> String tempstr="ws_seldate.dll";<br> tempstr="不能打开动态联接文件: "+tempstr;<br> MessageBox(Application->Handle,tempstr.c_str(),"错误",MB_ICONERROR+MB_OK);<br> }<br>