473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Importing a C#.NET dll into Delphi

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

May 24 '07 #1
4 14379
hi Sarah,

Are you checking the "Register for COM Interop" checkmark? in the project
config options?

<sa************@hotmail.comwrote in message
news:11**********************@o5g2000hsb.googlegro ups.com...
>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

May 24 '07 #2

Aha!

Thanks.

May 25 '07 #3
Hi,

That is the easiest way, but you should do it correctly and generate a guid
and place the correct directives in the assemblyinfo.cs file.

I do not have with me right now a project with all these features but will
get it for you on monday

<sa************@hotmail.comwrote in message
news:11*********************@u30g2000hsc.googlegro ups.com...
>
Aha!

Thanks.

May 25 '07 #4
I can now access the class and functions in my COM dll. However, it's
a visual control, how do I get it to actually appear? It appears fine
if I call the dll from another .NET project, but if I call if from
Delphi, I can't get it to appear. What do I have to do differently?
At the moment I just initialise the class.

Cheers.

May 30 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Erva | last post by:
Hi, Is there someone who has moved from Delphi to VS.NET? I'am using Delphi currently but seriously considering to moving VS.NET. I would like to hear if someone has already done that, is it...
10
by: Arda Han | last post by:
I am migrating my some applications from Delphi to C#. But... Yes But I don't know C# professionally. I am using DLL in delphi like this : ..... const RFID_103_485IO = 'Cihaz.dll'; ...
3
by: lukeharpin | last post by:
Currently I have been developing applications in Delphi 7. Recently I meet up with a friend of mine who previously developed in Delphi, from version 1 - 7. When Delphi 8 .net was release he found...
7
by: Sanjay Kedare | last post by:
Hi, I am evaluating various alternatives of converting Delphi (Ver 4.0) screens to C# screens. Are there any tools available for such conversion? if yes how much conversion do they achieve? The...
13
by: lukeharpin | last post by:
Hi World, We have been developing Engineering software in Delphi 3,4,5,6,7 for a few years now. This morning we had a discussion about OOP and re-programming the software to which the question...
11
by: David Lozzi | last post by:
Hello, I need to automate importation of a excel file into a table. Here's my scenario: I'm writing an ASP.NET application where users can pull reports on imported data. The imported data is...
1
by: Thomas Due | last post by:
Hi, I manage an rather old application in which we have some fairly complex (ugly) Delphi code. This is Delphi 6 we're talking about. Among all this Delphi code there is method for formating a...
4
by: =?Utf-8?B?ZGF2ZWJ5dGhlc2Vh?= | last post by:
Dear List, We have a large application written in Delphi. I am writing a mobile app written in .NET (C#) which reads and writes into the Delphi applications Oracle database via a .NET Web...
11
by: gnuist006 | last post by:
Is there a Delphi equivalent in the C world or Scheme/LISP world ? Recently, Delphi is in resurgence. In Russia people are using like crazy. For example, Bolega has written a free image...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.