A
ABA
Unregistered / Unconfirmed
GUEST, unregistred user!
library Dll_1;<br><br>{ Important note about DLL memory management: ShareMem must be the<br> first unit in your library's USES clause AND your project's (select<br> Project-View Source) USES clause if your DLL exports any procedures or<br> functions that pass strings as parameters or function results. This<br> applies to all strings passed to and from your DLL--even those that<br> are nested in records and classes. ShareMem is the interface unit to<br> the BORLNDMM.DLL shared memory manager, which must be deployed along<br> with your DLL. To avoid using BORLNDMM.DLL, pass string information<br> using PChar or ShortString parameters. }<br><br>uses<br> SysUtils,<br> Classes,system;<br><br>//{$R *.res}<br><br>function CurrChange(Amount: real): string;stdcall;<br>var<br> str,str1,str2:widestring;<br> j:integer;<br>begin<br> if (Amount<0) or(Amount>99999999.99) then<br> begin<br> currchange:=floattostr(Amount);<br> exit<br> end;<br> str1:='零千零佰零拾零万零千零佰零拾零圆零角零分';<br> str2:='零壹贰叁肆伍陆柒捌玖';<br> str:=floattostr(int(Amount*100));<br> for j:=1 to length(str) do<br> str1[19-2*length(str)+2*j]:=str2[(strtoint(str[j])+1)];<br><br> if (str1[7]='零') then str1[7]:=' ';<br> if (str1[15]='零') then str1[15]:=' ';<br><br> for j:=1 to length(str1) do<br> if str1[j]='零' then str1[j+1]:=' ';<br><br> if (str1[17]='零') and (str1[19]='零') then str1:=str1+'整';<br><br> if str1[17]='零' then str1[17]:=' ';<br> if str1[19]='零' then str1[19]:=' ';<br><br> for j:=0 to 6 do<br> if (str1[2*j+1]='零') and (str1[2*j+3]='零') then str1[2*j+1]:=' ';<br><br> str2:='';<br><br> for j:=1 to length(str1) do<br> str2:=str2+trim(str1[j]);<br><br> if str2[1]='零' then str2[1]:=' ';<br> str2:=trim(str2);<br> if str2[1]='万' then str2[1]:=' ';<br> str2:=trim(str2);<br> if str2[1]='零' then str2[1]:=' ';<br> str2:=trim(str2);<br> if str2[1]='圆' then str2[1]:=' ';<br> for j:=1 to length(str2)-1 do<br> if str2[j]='零' then<br> if (str2[j+1]='万') or (str2[j+1]='圆') then str2[j]:=' ' ;<br> str1:='';<br> for j:=1 to length(str2) do<br> str1:=str1+trim(str2[j]);<br> currchange:=str1;<br>end;<br><br>Exports<br> CurrChange;<br><br>begin<br>end.<br>上面的代码是DLL的。<br>我使用的时候,提示“无法定位程序到输入点CURRCHANGE于动态连接库DLL_1.DLL上”。<br>不知道是什么原因?大家帮帮忙?<br>