Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15855

[RESOLVED] Embed type information from TLB into OCX?

$
0
0
In an ActiveX UserControl project (OCX) I added a type information thought a TLB file for an object that this component need to expose to the client project.

Specifically, this type info is for the Printer object.

Code in the ocx project, from a GlobalMultiUse class (predeclared global class) I return the object like this:

Code:

Public Property Get Printer() As VBPrinter.Printer
    Set Printer = mPrn
End Property

being VBPrinter the name of the TLB.

The problem is that this works as long as the TLB is registered on the machine, but if the TLB is not registered the ocx returns the error "Error loading DLL".

I thought that the TLBs were only needed when the ocx was uncompiled, but in this case it seems to require it.

The question: how can I embed the type information inside the OCX to get rid of the TLB dependency from the client?

I'm attaching sample and test projects, along with the TLB in question.

PS: this is intended to be used in non-VB6 environments that lacks of the Printer object and a type library for the Printer object (It makes little sense from a VB6 perceptive since Vb6 already has type information for the Printer object, hence the clarification)

Thank in advance.
Attached Files

Viewing all articles
Browse latest Browse all 15855

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>