S
slush
Unregistered / Unconfirmed
GUEST, unregistred user!
我用Delphi写的COM,接口中有一个函数,返回值是widestring类型,为何在VB中一调用就发生提示为"应用程序发生异常 未知的软件异常(0x0eedfade),位置为0x77e6a4e1"的错误?谢谢!!
////////////////////////////////////////////////
type
TLegendToPoModel = class(TTypedComObject, ILegendToPoModel)
protected
function InitMe(const ActiveKeyStr: WideString): WideString; stdcall;
end;
implementation
uses ComServ;
function TLegendToPoModel.InitMe(const ActiveKeyStr: WideString): WideString;
begin
result:='Init Ok!';//Result:='',也一样有错误?
end;
////////////////////////////////////
Private Sub Command1_Click()
Dim L As New LToPoMODEL.LegendToPoModel
MsgBox L.InitMe("")
Set L = Nothing
End Sub
////////////////////////////////////////////////
type
TLegendToPoModel = class(TTypedComObject, ILegendToPoModel)
protected
function InitMe(const ActiveKeyStr: WideString): WideString; stdcall;
end;
implementation
uses ComServ;
function TLegendToPoModel.InitMe(const ActiveKeyStr: WideString): WideString;
begin
result:='Init Ok!';//Result:='',也一样有错误?
end;
////////////////////////////////////
Private Sub Command1_Click()
Dim L As New LToPoMODEL.LegendToPoModel
MsgBox L.InitMe("")
Set L = Nothing
End Sub