Search code examples
delphidlldelphi-2007

Delphi ntextcat - how to implement


I am trying to access ntextcat dll from Delphi 2007.

Registering the dll´s failed (I have tried 32 and 64Bit regsvr32). Importing the typelibrary in Delphi failed as well (as .dll and .Net).

Is there anybody out there who got access to ntextcat within Delphi?


Solution

  • This is a .net library. As such it is not readily accessible from unmanaged code such as Delphi. If you do want to consume it from Delphi you'll need to create a wrapper. For instance by using one of the following:

    • A COM interface.
    • A mixed mode C++/CLI assembly that wraps the managed library and exposes an unmanaged interface.
    • A wrapper based on Robert Giesecke's UnmanagedExports.

    The latter two allow you to consume a .net assembly as a native DLL.

    If the library has a rich and broad interface then the task of wrapping it if not going to be terribly easy or convenient. You may be better finding a different library that is easier to consume.

    If the library has a small interface, or if you only need a small part of its capabilities, then making a wrapper may be more tractable.