我的这个DLL在调用后报错是什么原因引起的?(100分)

B

bird

Unregistered / Unconfirmed
GUEST, unregistred user!
DLL中的 程序如下
function GetDay(dat:Tdate):string;
var
Year,Month,Day:word;
TempDay,TempMonth:string;
begin
DecodeDate(Dat,Year,Month,Day);
if length(IntToStr(Month))=1 then
TempMonth:='0'+IntToStr(Month)
else
TempMonth:=IntToStr(Month);
if length(IntToStr(Day))=1 then
TempDay:='0'+IntToStr(Day)
else
TempDay:=IntToStr(Day);
GetDay:=TempMonth+TempDay;
end;
在程序中调用能返回正确的值,但产生一个异常
“Invalid pinter operation”
请问这是什么原因引起的,我怎么样能解决
------------------------------------
我已经一个月访问不到这了,DNS 连大富翁的IP都解析不到
//我的ISP是北京的东方网景
今天无心一试,竟奇迹般的上来了,真让我高兴!!!!!!!!!
 
错误发生在调用过程中,还是在调用返回后?
你可改String为PChar返回类型试试。
 
是在调用返回后。
刚才我在徐新华的《DELPHI3编程指南》中看到DLL输出
长字符串类型时需要在 DLL和调用程序中加如SHAREMEM单元,
我照着做了之后,错误变成非法操作!
这是怎么回事?那位大侠能给我讲一讲啊~~~~~~~~:)
 
将String转换成PChar反回,因为Dll忌讳用长字符串。
 
将String转换成PChar!
dll的export函数要用那些符合C格式的类型!
 
多人接受答案了。
 
顶部