Pregunta

I have converted a Delphi 2005 OCX project to XE2, which caused the original TLB to be changed to a RIDL. Using View | Type Library in XE2 is similar to Delphi 2005, and I can see all the interfaces and properties/methods.

The original 2005 project already had a _TLB.pas unit generated from the original TLB, but I needed to add a new property, so I went ahead and did that to the RIDL and chose the "Refresh Implementation" option.

However, while the original _TLB.pas contained a section near the end like this:

// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name     : TTransControlSHX
// Help String      : TransControlSHX Control
// Default Interface: ITransControlSHX
// Def. Intf. DISP? : No
// Event   Interface: ITransControlSHXEvents
// TypeFlags        : (34) CanCreate Control
// *********************************************************************//
  TTransControlSHX = class(TOleControl)

The new _TLB.pas file generated from the RIDL does not contain this section.

How do I get it back? Without it, my applications using the OCX all complain that the TTransControlSHX is an Undeclared Identifier.

¿Fue útil?

Solución

The older versions of Delphi created the OLE proxy class in the COM's TLB pas file, however when you want to write the client code to use that COM object, you must import the type library (select "as unit") and you will have your OLE proxy class in THAT TLB pas file.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top