Board index » delphi » Using Typelibaries made with mktyplib or midl

Using Typelibaries made with mktyplib or midl

Hello all,

I've a problem that maybe one of you knows the answer for:

I've made a few typelibraries in IDL [to be honest I generated them from
typelibraries I made with the Delphi typelibrary Editor and converted the
.tlb files to IDL with OleView ;)] and 'compiled' those with mktyplib to
.tlb-files. No problems, works fine. After that I used tlibimp.exe to make
the corresponding delphi units [you know, those <X>_TLB.pas files]. Also no
problems here. But when I build a Delphi project that uses one of those
typelibraries I get a linking error: RLINK32: Unsupported 16bit resource in
file <name of the typelibrary>!

I've found the reason for this problem: Delphi [i use Delphi 3.02 BTW] uses
Ole Automation 1.0 [aka stdole32.tlb] for the definition of IDispatch and
other standard OLE-automation interfaces and includes a reference to
stdole32.tlb in its .tlb-files. But if I make a typelibary with mktyplib or
midl, the Ole Automation 2.0 typelibrary is used [aka stdole2.tlb]. RLINK
however has some problems with this typelibrary because in this standard(!)
typelibrary is a 16 bits resource included. Whatever I tried with mktyplib
and midl, I couldn't configure or use them in a way that they include
stdole32.tlb instead of stdole2.tlb. But in my opinion mktylib or midl are
not wrong but Delphi or to be more exact is: RLINK is the problem. Is there
a beter version of rlink.dll? Because I really want to use IDL instead of
the Delphi typelibrary editor. I've made a framework consisting of 6
typelibraries and it's almost impossible to maintain those with the
typelibrary editor of Delphi. The typelibraries are not very complicated but
Delphi's typelibrary editor is really a shame.

If someone can help me or can give me a hint I will be very gratefull. Thanx
for listening.

Armand Simonis, A.R.J.B.Simo...@epona.nl

 

Re:Using Typelibaries made with mktyplib or midl


Hello all,

I solved my own problem. Rlink32.dll of Delphi 3 has a bug. I copied the
rlink32.dll of Delphi 4 in my Delphi 3 bin-directory and it works fine. Now
I can define and edit typelibraries in IDL and compile those with mktyplib
or midl. After that I can use the typelibraries with Delpi 3.02 *and* Delphi
4 without any problems. At last I don't have to use that ^&&*^*%$##
Typelibrary Editor of Delphi anymore. And I feel much safer now that my
typelibrary source is in ASCII-format. IMO sources only in binary format
(like tlb-files) are not a good idea.

-- Armand Simonis

Quote
Armand Simonis <A.R.J.B.Simo...@epona.nl> wrote in message

news:7f28ko$gdm3@forums.borland.com...
Quote
>Hello all,

>I've a problem that maybe one of you knows the answer for:

>I've made a few typelibraries in IDL [to be honest I generated them from
>typelibraries I made with the Delphi typelibrary Editor and converted the
>.tlb files to IDL with OleView ;)] and 'compiled' those with mktyplib to
>.tlb-files. No problems, works fine. After that I used tlibimp.exe to make
>the corresponding delphi units [you know, those <X>_TLB.pas files]. Also no
>problems here. But when I build a Delphi project that uses one of those
>typelibraries I get a linking error: RLINK32: Unsupported 16bit resource in
>file <name of the typelibrary>!

>I've found the reason for this problem: Delphi [i use Delphi 3.02 BTW] uses
>Ole Automation 1.0 [aka stdole32.tlb] for the definition of IDispatch and
>other standard OLE-automation interfaces and includes a reference to
>stdole32.tlb in its .tlb-files. But if I make a typelibary with mktyplib or
>midl, the Ole Automation 2.0 typelibrary is used [aka stdole2.tlb]. RLINK
>however has some problems with this typelibrary because in this standard(!)
>typelibrary is a 16 bits resource included. Whatever I tried with mktyplib
>and midl, I couldn't configure or use them in a way that they include
>stdole32.tlb instead of stdole2.tlb. But in my opinion mktylib or midl are
>not wrong but Delphi or to be more exact is: RLINK is the problem. Is there
>a beter version of rlink.dll? Because I really want to use IDL instead of
>the Delphi typelibrary editor. I've made a framework consisting of 6
>typelibraries and it's almost impossible to maintain those with the
>typelibrary editor of Delphi. The typelibraries are not very complicated
but
>Delphi's typelibrary editor is really a shame.

>If someone can help me or can give me a hint I will be very gratefull.
Thanx
>for listening.

>Armand Simonis, A.R.J.B.Simo...@epona.nl

Other Threads