0

I'm trying to import a third-party .NET type library (COM server DLL) using tlibimp.exe (version 11.0). This basically works fine, but the results differ when I run it on different computers, one running Windows XP, the other Windows 7. What's worse, the code generated on the Win7 machine doesn't compile.

Both machines have:

  • Borland C++ (RAD Studio) 2007
  • tlibimp.exe version 11.0
  • the same .NET framework versions installed (as far as I can tell, Borland 2007 uses .NET v2)
  • bcc32.exe version 5.93

The compiler fails in the OCX.h with:

   Parameter mismatch in write access specifier of property Font

The relevant line of code on the XP machine (which compiles ok) is:

  __property Graphics::TFont * Font={ read=GetTFontProp, write=_SetTFontProp, stored=false, index=-512 };

The same line on the Win7 machine (which fails) is:

  __property IFontDisp* Font={ read=get_Font, write=set_Font, stored=false };

Now I'm not really sure where this difference comes from. Any ideas?

cheers Hendrik

Johan
  • 74,508
  • 24
  • 191
  • 319
Hendrik
  • 569
  • 3
  • 12
  • How can a .net COM server export a VCL `Graphics::TFont`? – David Heffernan Jul 26 '11 at 15:08
  • I have no clue, but it seems to work. Is it maybe some Borland component wrapper magic? – Hendrik Jul 26 '11 at 15:26
  • I should add that there are huge differences between the two versions of the class in question, not just the one line. For a start, the WinXP version inherits from TOleControl, and the Win7 from Oleserver::TOleServer – Hendrik Jul 26 '11 at 15:33
  • I know other tools which have or had [problems](http://sourceforge.net/tracker/?func=detail&atid=642714&aid=1632584&group_id=105970) in newer windows versions. However the output generated on xp always worked in newer windows versions. Maybe this is also the case for tlibimp. – wimh Jul 26 '11 at 19:45

1 Answers1

0

This may or may not help but I had a similar issue trying to import two type libraries into delphi, from c sharp assemblies.

One type library (A) inherited from TOLeServer, the other (B) from TOleControl and I couldn't see why, as both assemblies which generated the type libraries were virtually identical.

The issue turned out to be that B had been registered with regasm and A hadn't. Registering A and re-generating the type library solved the issue.

Philtron
  • 43
  • 4