🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1072

Re: DllRegisterServer

#1072
From: Remy Lebeau (TeamB)
Date: Sun, 18 Nov 2007 20:36
52 lines
2729 bytes
"mauro" <m.russo@uniplan.it> wrote in message
news:473ed1eb$1@newsgroups.borland.com...

> When I generated the project I chose only the options "C++" and
> multi-thread.

In other words, you use the "File > New > DLL Wizard" option?  If so, then
you do ot need to worry about DllRegisterServer() at all.

> Really, I am very interested to learn how to export classes from a DLL.

You can't.  Even if you could, you wouldn't be able to import them into
non-Borland compilers.

> In fact, my DLL has a class to export, but I did not know
> how to do it

Don't even try to go that route to begin with.

> I exported functions to manage the class.

That is what you have to do.

> Then, when we used in Borland Delphi, we used a Delphi class
> which uses the exported function, in order to have in Delphi a
> class exactly as that in the DLL.

For Delphi and C++Builder, it would be better to make a Package instead of a
DLL.  Then you can use the original class directly.  In order to support
non-Borland compilers, you will have to continue with the function approach.

> My friend, working on VS, is used to register every DLL.

Again, that only applies to DLLs that host COM objects specifically.  It
does not apply to all DLLs in general.  Certainly not the kind of DLL you
have made.

> He thinks that he needs to register the DLL in order to use it.

He's mistaken.

> I believe the point is that he is using C# and so I could not
> tell him how to translate in C# the way I use in C++ to use
> the DLL

.NET languages, such as C#, need to use PInvoke to access unmanaged DLLs.
C++Builder does not produce native .NET assemblies.  You need Delphi.NET for
that.


Gambit
Technical Details
Message-ID: <4740a31c@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feed.tweaknews.nl!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <473dfb2a$1@newsgroups.borland.com> <473e0261$1@newsgroups.borland.com> <473ed1eb$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,da034d2954595877
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <473dfb2a$1@newsgroups.borland.com> <473e0261$1@newsgroups.borland.com> <473ed1eb$1@newsgroups.borland.com>
Subject: Re: DllRegisterServer
Date: Sun, 18 Nov 2007 12:36:57 -0800
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 75.83.29.61
Message-ID: <4740a31c@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1195418396 75.83.29.61 (18 Nov 2007 12:39:56 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder6.cambrium.nl!feed.tweaknews.nl!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail