D7+update1
windows2003
ADO2.8+sql server 2000
一个使用RemoteDatamodule的exe服务器,6个client不停调用上面的一个取得当前日期的函数,调用几百次或者几千次后,在Server上会报一个DAX错误,奇怪的是错误消息是乱码当尝试debug的时候,大致在出现错误的时候,debugger没有俘获到,却报错在delphi原码中查找错误消息,发现在comobj.pas有:
[code]
function TComObjectFactory.CreateInstanceLic(const unkOuter: IUnknown;
const unkReserved: IUnknown; const iid: TIID; const bstrKey: WideString;
out vObject): HResult; stdcall;
var
ComObject: TComObject;
begin
// We can't write to a nil pointer. Duh.
if @vObject = nil then
begin
Result := E_POINTER;
Exit;
end;
// In case of failure, make sure we return at least a nil interface.
Pointer(vObject) := nil;
// Check for licensing.
if FSupportsLicensing and
((bstrKey <> '') and (not ValidateUserLicense(bstrKey))) or
((bstrKey = '') and (not HasMachineLicense)) then
begin
Result := CLASS_E_NOTLICENSED;
Exit;
end;
// We can only aggregate if they are requesting our IUnknown.
if (unkOuter <> nil) and not (IsEqualIID(iid, IUnknown)) then
begin
Result := CLASS_E_NOAGGREGATION;
Exit;
end;
try
ComObject := CreateComObject(UnkOuter);
except
if FShowErrors and (ExceptObject is Exception) then
with Exception(ExceptObject) do
begin
if (Message <> '') and (AnsiLastChar(Message) > '.') then
Message := Message + '.';
MessageBox(0, PChar(Message), PChar([red]SDAXError[/red]), MB_OK or MB_ICONSTOP or
MB_SETFOREGROUND);
end;
Result := E_UNEXPECTED;
Exit;
end;
Result := ComObject.ObjQueryInterface(IID, vObject);
if ComObject.RefCount = 0 then ComObject.Free;
end;
[/code]
也就是 ComObject := CreateComObject(UnkOuter);出现了例外。请问,为什么会出现这个错误?如何解决?或者如何能debug到错误的地方?久病成良医--多试
千人之诺诺,不如一士之谔谔--兼听
發表人 - mustapha.wang 於 2005/02/01 16:12:41
windows2003
ADO2.8+sql server 2000
一个使用RemoteDatamodule的exe服务器,6个client不停调用上面的一个取得当前日期的函数,调用几百次或者几千次后,在Server上会报一个DAX错误,奇怪的是错误消息是乱码当尝试debug的时候,大致在出现错误的时候,debugger没有俘获到,却报错在delphi原码中查找错误消息,发现在comobj.pas有:
[code]
function TComObjectFactory.CreateInstanceLic(const unkOuter: IUnknown;
const unkReserved: IUnknown; const iid: TIID; const bstrKey: WideString;
out vObject): HResult; stdcall;
var
ComObject: TComObject;
begin
// We can't write to a nil pointer. Duh.
if @vObject = nil then
begin
Result := E_POINTER;
Exit;
end;
// In case of failure, make sure we return at least a nil interface.
Pointer(vObject) := nil;
// Check for licensing.
if FSupportsLicensing and
((bstrKey <> '') and (not ValidateUserLicense(bstrKey))) or
((bstrKey = '') and (not HasMachineLicense)) then
begin
Result := CLASS_E_NOTLICENSED;
Exit;
end;
// We can only aggregate if they are requesting our IUnknown.
if (unkOuter <> nil) and not (IsEqualIID(iid, IUnknown)) then
begin
Result := CLASS_E_NOAGGREGATION;
Exit;
end;
try
ComObject := CreateComObject(UnkOuter);
except
if FShowErrors and (ExceptObject is Exception) then
with Exception(ExceptObject) do
begin
if (Message <> '') and (AnsiLastChar(Message) > '.') then
Message := Message + '.';
MessageBox(0, PChar(Message), PChar([red]SDAXError[/red]), MB_OK or MB_ICONSTOP or
MB_SETFOREGROUND);
end;
Result := E_UNEXPECTED;
Exit;
end;
Result := ComObject.ObjQueryInterface(IID, vObject);
if ComObject.RefCount = 0 then ComObject.Free;
end;
[/code]
也就是 ComObject := CreateComObject(UnkOuter);出现了例外。请问,为什么会出现这个错误?如何解决?或者如何能debug到错误的地方?久病成良医--多试
千人之诺诺,不如一士之谔谔--兼听
發表人 - mustapha.wang 於 2005/02/01 16:12:41
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货