在李维的经典的delphi的ado/mts的第九章里面,在一个mts/com+对象里面调用另一个对象的时候,在olecheck(objectcontext.createinstance(....,..,..))总是出错,怎么回事?各位大侠?是不是要引用一个单元?还是
源码:
var bookobj:Imtsbooksobj;
aps:Iappserver;
options:Tgetrecordoptions;
...
begin
if verifycookie(vcookie) then
begin
try
olecheck (objectcontext.createinstanceclass_mtsbooksobj,iid_Imtsbooksobj,bookobj));
......
help ???
源码:
var bookobj:Imtsbooksobj;
aps:Iappserver;
options:Tgetrecordoptions;
...
begin
if verifycookie(vcookie) then
begin
try
olecheck (objectcontext.createinstanceclass_mtsbooksobj,iid_Imtsbooksobj,bookobj));
......
help ???
Unit
ComObjCategory
COM utilitiesprocedure OleCheck(ECode: HResult);DescriptionOleCheck is used to wrap many COM routines, so that if that routine fails, users will have an opportunity to handle it in the resulting exception that is raised.If ECode is a value less than zero, OleCheck raises an EOleSysError exception that specifies the error code.