🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Sending a class to another application (on another computer)

#7688
From: Bruce Salzman
Date: Thu, 25 Mar 2004 20:34
35 lines
2838 bytes
"aaaa" <aaaa@aaaa.com> wrote in message
news:40629b79$1@newsgroups.borland.com...
> We can import a class from a DLL (Windows) or from shared object
(Linux)
> and create instances of the imported class in our application.
>
> Is there a way of sending a class to another application (may be on
another
> computer) so that receiver application can create instances of the
received
> class?

I assume you mean that the class implementation is in a DLL ( I can't
speak to the Linux version). When an application uses the class's
interface (usually in a .h file) to instantiate a class object it needs
access to the constructor, destructor, and any other class methods your
application calls. Any methods that are not defined "inline" in the .h
file need to be exported from the DLL so that the linker can resolve
them with the calls your application makes. This is usually done with a
.lib file (generated from the DLL) that is then added to your
application project.

You don't really send classes to other applications. They either use the
class definition to create their own instances, or receive copies of (or
pointers to) objects created in your application. The second application
would also need to be compiled with the definition of the class (.h
file) so that it knows what the object is and how to use it, and thus
also have access to the DLL. You also need to place the object in shared
storage of some kind so that the second process can access it. Also, if
the object is created on the heap, the process that creates the object
is responsible for deleting it.

HTH,
Bruce
Technical Details
Message-ID: <40634259$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!news.usenetserver.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <40629b79$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,b7ebcf8966f444ef
X-Google-Attributes: gid10cc67,public
X-Google-Thread: 11096a,b7ebcf8966f444ef
X-Google-Attributes: gid11096a,public
X-Google-Thread: 10db1e,b7ebcf8966f444ef
X-Google-Attributes: gid10db1e,public
X-Google-ArrivalTime: 2004-03-25 12:40:11 PST
From: " Bruce Salzman" <bruce@nospam.org>
Newsgroups: borland.public.cppbuilder.nativeapi,borland.public.cppbuilder.oodesign,borland.public.cppbuilder.webservices.soap
References: <40629b79$1@newsgroups.borland.com>
Subject: Re: Sending a class to another application (on another computer)
Date: Thu, 25 Mar 2004 14:34:33 -0600
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 24.94.231.89
Message-ID: <40634259$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1080246873 24.94.231.89 (25 Mar 2004 12:34:33 -0800)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!news.maxwell.syr.edu!c03.atl99!news.usenetserver.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail