怎样同时在一个工程中使用多个 TLB 文件? 在线等待 立刻给分 (300分)

  • 主题发起人 主题发起人 mstar
  • 开始时间 开始时间
M

mstar

Unregistered / Unconfirmed
GUEST, unregistred user!
我在一个 COM SERVER EXE 项目中同时使用了 COMSERVER.TLB 和 XM.TLB,其中 XM.TLB USES COMSERVER.TLB ,结果启动的时候就出现下面的错误提示了。
---------------------------
Debugger Exception Notification
---------------------------
Project ComServer.exe raised exception class EOleError with message 'Type information missing for class TRDM_MainModule'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
拜托各位大侠 路见不平 ... ...
 
高手为钱忙,呵呵
 
这里还是挺多高手的 继续等待中 ... ...
 
可能是COM启动时少了支持文件!
 
如果是一个 TLB 就很正常了
 
constructor TTypedComObjectFactory.Create(ComServer: TComServerObject;
TypedComClass: TTypedComClass;
const ClassID: TGUID;
Instancing: TClassInstancing;
ThreadingModel: TThreadingModel);
var
ClassName, Description: WideString;
begin
if ComServer.TypeLib.GetTypeInfoOfGUID(ClassID, FClassInfo) <> S_OK then
raise EOleError.CreateResFmt(@STypeInfoMissing, [TypedComClass.ClassName]);
// 问题出在上面这行 有遇见过的吗?
OleCheck(FClassInfo.GetDocumentation(MEMBERID_NIL, @ClassName,
@Description, nil, nil));
inherited Create(ComServer, TypedComClass, ClassID,
ClassName, Description, Instancing, ThreadingModel);
end;
 
Sometimes you need to access properties of classes declared else
where that are protected.
The simplest way to achieve this is to use the following
declaration in your unit:
TExposed = class();

For example:
TExposedWinControl = class(TWinControl);

Since TExposedbutton is now declared in your unit, you can access everything that is protected -- including whatever is inherited. How to use it? Safely hard-cast it as follows:

if Sender is TWinControl then

with TExposedWinControl(Sender)do

begin

//Caption &amp;
Text is the same in TWinControl
ShowMessage(Caption);

Text := 'Easy, isn''t it?';

end;

 
自己解决了这个问题 散分吧
 
后退
顶部