X
xiaoshi
Unregistered / Unconfirmed
GUEST, unregistred user!
小弟在用cb编写一个程序需要调用别人用vb编写的dll.<br>该dll中只有两个函数 Sub glsy(ByRef a As Single,ByRef b As Single,<br> ByRef c As Single,ByRef d As Single,ByRef a1 As Single,ByRef b1 As Single,<br> ByRef c1 As Single,ByRef d1 As Single)<br>Sub qjsy(ByRef q() As Single,ByRef w() As Single)<br>动态调用dll的cb原码;<br>void __fastcall TForm1::Button1Click(TObject *Sender)<br>{<br> float x1=1,x2=1,x3=1,x4=1,x5=1,x6=1,x7=1,x8=1;<br> float *y1=&x1,*y2=&x2,*y3=&x3,*y4=&x4,*y5=&x5,*y6=&x6,*y7=&x7,*y8=&x8;<br> HINSTANCE hInst=NULL;<br> hInst=LoadLibrary("d://temp//rlsy.dll");<br> if(hInst)<br> {<br> glsy=(void (__pascal *)(float *,float *,float *,<br> float *,float *,float *,float *,float *))GetProcAddress(hInst,"glsy");<br> if(glsy)<br> glsy(y1,y2,y3,y4,y5,y6,y7,y8);<br> else<br> ShowMessage("Cannot obtain function pointer");<br> }<br> else<br> ShowMessage("Cannot load rlsy.dll");<br> FreeLibrary(hInst);<br>}<br>执行后,发现不能获得函数指针.<br>请给位大虾不吝赐教,小弟感激不尽!<br><br>