🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.csharpbuilder.ide.general
3 messages
3 total messages Started by Mark Heschl Wed, 10 May 2006 21:00
compiling C# library
#122
Author: Mark Heschl
Date: Wed, 10 May 2006 21:00
33 lines
2313 bytes
Hi,

I am trying to compile a C# dll so that I can use the functionality in a
Delphi (win32) app.  The reason for this is because Crystal Reports XI does
not work 100% in Delphi or Delphi.NET.

The steps I take when it doesn't work are:
1) Compile through BDS2006 and compile as an assembly (application type)
2)  From the command line, run "regasm name.dll /tlb" to generate the tlb
file
3)  From the Win32 environment, go to Component | Import Component and then
select Import .NET Assembly.

When I get to the last screen, no classes are listed and no class
declarations are evident in the generated name_tlb.pas file

However, in order to get it to work:
1)  From the command line, compile  using "csc /t:library name.cs"
2)  From the command line, run "regasm name.dll /tlb" to generate the tlb
file
3)  From the Win32 environment, go to Component | Import Component and then
select Import .NET Assembly.

When I get to the last screen, the classes are present and the generated
name_tlb.pas file has the class declarations and I can access the procedures
that I want.

My question is, how do I get the BDS2006 C# flavor IDE to compile the
project as if it were compiling witt the "/t:library" switch?

Thanks

Mark
Re: compiling C# library
#123
Author: Marc Rohloff TeamB
Date: Thu, 11 May 2006 01:22
12 lines
1574 bytes
On Wed, 10 May 2006 15:00:25 -0600, Mark Heschl wrote:

> My question is, how do I get the BDS2006 C# flavor IDE to compile the
> project as if it were compiling witt the "/t:library" switch?

There is a checkbox somewhere in the options which makes the IDE
display the command line parameters it is using. You may want to try
this to see what is happening.

-- 
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Re: compiling C# library
#124
Author: Andre
Date: Mon, 29 May 2006 07:02
62 lines
3060 bytes
"C# dll so that I can use the functionality in a
> Delphi (win32) app."

Your problem lies within the AssemblyInfo.cs file of your C# dll. .NET 
Assemblies does not register under COM until you explicitly make .NET 
assmeblies visiable to COM.

Open your AssemblyInfo.cs file in C# IDE. Scroll to the very bottom of the 
file. You'll see 3 clauses:

[assembly: ComVisible(false)]
//[assembly: Guid("")]
//[assembly: TypeLibVersion(1, 0)]

Set the [assembly: ComVisible(true)]
If you find the other 2 clauses usefull, by al means

I think this would sort you out.
ps: i don't think is nesseary to use the command line params to compile.


"Mark Heschl" <mark@no.spam.com> wrote in message 
news:44625449$1@newsgroups.borland.com...
> Hi,
>
> I am trying to compile a C# dll so that I can use the functionality in a
> Delphi (win32) app.  The reason for this is because Crystal Reports XI 
> does
> not work 100% in Delphi or Delphi.NET.
>
> The steps I take when it doesn't work are:
> 1) Compile through BDS2006 and compile as an assembly (application type)
> 2)  From the command line, run "regasm name.dll /tlb" to generate the tlb
> file
> 3)  From the Win32 environment, go to Component | Import Component and 
> then
> select Import .NET Assembly.
>
> When I get to the last screen, no classes are listed and no class
> declarations are evident in the generated name_tlb.pas file
>
> However, in order to get it to work:
> 1)  From the command line, compile  using "csc /t:library name.cs"
> 2)  From the command line, run "regasm name.dll /tlb" to generate the tlb
> file
> 3)  From the Win32 environment, go to Component | Import Component and 
> then
> select Import .NET Assembly.
>
> When I get to the last screen, the classes are present and the generated
> name_tlb.pas file has the class declarations and I can access the 
> procedures
> that I want.
>
> My question is, how do I get the BDS2006 C# flavor IDE to compile the
> project as if it were compiling witt the "/t:library" switch?
>
> Thanks
>
> Mark
>
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads