Importing a C#.NET dll into Delphi Options

S

sarah_c_clough

I have a dll created in C#.net, that I wish to call from Delphi 5. I
have strong-named the assembly, deployed it in the GAC, and registered
it with RegAsm, but whenever I create the pas file (either through the
'Import Type Library' option in Delphi, or via an InteropUtils program
I found on the web) it does not contain any types. In the 'const'
section in the pas file there is one GUID for the dll, but nothing
else, and there is no 'type' section at all.

Can somebody tell me where my problem lies, whether it's how I create
my dll, or am I missing a step before creating it and deploying it
into the GAC, or is there something I need to do before creating the
pas? (I'm pretty sure it's not the latter of these three, as when I
use the Delphi 'import type library', no classes are shown in the
'class names' box).

When I run RegAsm, I have to use the tlb option otherwise it tells me
'No types were registered'. I don't know if this is related, or what
it's telling me.

I tried disassembling the dll using ildasm, then reassembling it using
ilasm, based on a tip I found on the internet, but after I've done
that I can't put it in the GAC as the strong-naming appears to become
invalidated.

Thanks.
Sarah
 
R

Rad [Visual C# MVP]

I have a dll created in C#.net, that I wish to call from Delphi 5. I
have strong-named the assembly, deployed it in the GAC, and registered
it with RegAsm, but whenever I create the pas file (either through the
'Import Type Library' option in Delphi, or via an InteropUtils program
I found on the web) it does not contain any types. In the 'const'
section in the pas file there is one GUID for the dll, but nothing
else, and there is no 'type' section at all.

Can somebody tell me where my problem lies, whether it's how I create
my dll, or am I missing a step before creating it and deploying it
into the GAC, or is there something I need to do before creating the
pas? (I'm pretty sure it's not the latter of these three, as when I
use the Delphi 'import type library', no classes are shown in the
'class names' box).

When I run RegAsm, I have to use the tlb option otherwise it tells me
'No types were registered'. I don't know if this is related, or what
it's telling me.

I tried disassembling the dll using ildasm, then reassembling it using
ilasm, based on a tip I found on the internet, but after I've done
that I can't put it in the GAC as the strong-naming appears to become
invalidated.

Thanks.
Sarah

Is the DLL COM Compliant? You'll run into a lot of problems if its not
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top