-
use of DLL : put an entire class in the dll source ? possible ?
hi,
i d like to put an entire class in a dll (an MFC extended one)
But there are some member variables in this one..
Shall i put them outside in application code and pass them by reference
(in this case ...what can i do for constructors and destructor ) ?
or
Can I really put the entire class in the library ? (I ve read it somewhere
but found it that weird because I ve not understood how handling of variables
was managed : writing of variables to be read ans vice&versa). So if it is
possible.. How can I do it as far as application and dll code are concerned
?
-
Re: use of DLL : put an entire class in the dll source ? possible ?
"kenny" <javatoto@yahoo.fr> wrote:
>
>hi,
>i d like to put an entire class in a dll (an MFC extended one)
>
>But there are some member variables in this one..
>Shall i put them outside in application code and pass them by reference
>(in this case ...what can i do for constructors and destructor ) ?
>or
>Can I really put the entire class in the library ? (I ve read it somewhere
>but found it that weird because I ve not understood how handling of variables
>was managed : writing of variables to be read ans vice&versa). So if it
is
>possible.. How can I do it as far as application and dll code are concerned
>?
Yes, you can place an entire 'class' in a MFC Extension DLL and use it just
as you would if it was statically compiled within your application. It can
be a very useful method to share common code between a suite of MFC applications.
(Your only other options are 'regular' DLLs, which would only allow you to
export 'C' style functions, or an ActiveX component.)
(However, be aware of a MFC Extension DLL limitations; it can only be used
with other MFC applications that are dynamically linked to the MFC libraries,
you have to make sure you handle dynamic loading/unloading, and use the AFX_EXT_CLASS
macro in your class definition to insure everything gets exported correctly.)
As to "member variables" are you referring to 'public' variables? (While
one might question the design...<smile>) you can reference them the same
as you would any class members.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks