王中王:
用Delphi写的一个Dll,写法对不对?
[阅读: 1240] 2005-07-21 03:42:07
为什么用C++链接时出错,Delphi使用时运行时报错?
library RotateTiff;
uses
ExceptionLog,
SysUtils,
Classes,IlDocImg, DLLsp96, TMultiP, ExtCtrls, ildoctb,DLL96V1;
{$R *.res}
function RotateTiffFile( AFileName : PChar): Integer; stdcall;
var
NPages : Integer;
tif: ILDocumentImage;
begin
Result := 0;
tif := ILDocumentImage.Create(nil);
try try
tif.ReadTifFile(AFileName, 0, 1);
tif.First;
for NPages := 1 to tif.TiffPageCount do begin
tif.Rotate(90, 0);
tif.TifSaveCompress := sFAXCCITT4;
tif.UpdateTiff;
tif.Next;
end;
tif.TifSaveCompress := sFAXCCITT4;
tif.Pack;
tif.TifSaveCompress := sFAXCCITT4;
tif.UpdateTiff;
Result := 1;
except
end;
finally
tif.Free;
end;
end;
exports
RotateTiffFile;
begin
end.
http://wangzw.wordpress.com/
个性化台历、日历制作
http://shop33697570.taobao.com/