Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Type Library Help

Status
Not open for further replies.

Drevan

Programmer
Feb 27, 2008
1
US
Hi,

I'm using Delphi 6, and I've run into a bit of a problem. I'm creating a DLL that is essentially a wrapper for a Delphi object. This code has been working for awhile now, but due to a change in the underlying object, the wrapper needs to be updated. Here's where I'm stuck.

There is a new property (called Contextor) on the Delphi object that gets and sets a TContextorControl. I have the contextor control, as it is defined in a separate TLB (in a project not written by me). How can I define the Contextor property with a Type of TContextorControl, a message shows up saying that TContextorControl is an invalid type.

I'm guessing that I need to somehow let my type library know what that interface of the TContextorControl is, but I'm not sure how to do that.

Any assistance would be greatly appreciated.

Thanks,
-Shane
 
You gave the answer. You need to define the type. If I make a unit with a function in it that requires a specific data type, I have to define that data type to any program that would use that unit. Which means I would have to put the type record in the interface section of the unit so that anyone may call it with the correct data type.

Now for your case, we need to go further. Let's say my unit uses another unit which has a specific data type defined in it. Now my unit knows of the data type and can use it. But the main program that calls my unit will not know of the data type to correctly work with it, and will bring an error much like what you've seen.

Short and best answer would be to find out the unit that the TContextorControl definition resides in and add it to your uses statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top