Connecting Tech Pros Worldwide Forums | Help | Site Map

How do I use classes from a DLL?

Jake D
Guest
 
Posts: n/a
#1: Jul 19 '05
I have found many examples on how to use a function from a DLL, but I
have a DLL (not written by me) that has various classes, and functions
within.
How can I create an object of a class type defined in the DLL and
access functions from the class?

Alf P. Steinbach
Guest
 
Posts: n/a
#2: Jul 19 '05

re: How do I use classes from a DLL?


On 13 Sep 2003 09:08:37 -0700, jdenley@richmondnursery.com (Jake D) wrote:
[color=blue]
>I have found many examples on how to use a function from a DLL, but I
>have a DLL (not written by me) that has various classes, and functions
>within.
>How can I create an object of a class type defined in the DLL and
>access functions from the class?[/color]

The C++ standard has nothing to say on the subject of DLLs (except a very
indirect adaption in the wording for when statics are initialized).

It doesn't even have anything to say on the subject of name mangling.

Not even on the existence of linkers.

In short, if you're using a different compiler than the one used to
create the DLL, there is little chance that you can use that DLL, unless
the DLL is designed to be language-independent, e.g. COM conventions.

On the other hand, _if_ you have a compatible compiler, see that compiler's
documentation. <ot>Presumably, judging from the terminology, this is on
the Windows platform, and so check out 'dllimport' & friends; MS keywords
that most/many/some compilers for that platform understand.</ot>

shakahshakah@yahoo.com
Guest
 
Posts: n/a
#3: Jul 19 '05

re: How do I use classes from a DLL?


The developer of the DLL should supply you with header files to compile
against and an import library to link with.

In article <d323dfa0.0309130808.28b6d2c1@posting.google.com >,
jdenley@richmondnursery.com (Jake D) wrote:[color=blue]
>I have found many examples on how to use a function from a DLL, but I
>have a DLL (not written by me) that has various classes, and functions
>within.
>How can I create an object of a class type defined in the DLL and
>access functions from the class?[/color]
Kevin Goodsell
Guest
 
Posts: n/a
#4: Jul 19 '05

re: How do I use classes from a DLL?


shakahshakah@yahoo.com wrote:
[color=blue]
> The developer of the DLL should supply you with header files to compile
> against and an import library to link with.[/color]

Please don't top post. See section 5 of the FAQ for posting guidelines.

http://www.parashift.com/c++-faq-lite/

Also, DLLs are not topical here. Please avoid posting off-topic
messages, even as a reply to a question. An alternative would be to send
the reply to a group where it is topical, and email the author of the
question with the location of your answer. Or you could email the author
directly with your answer.

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

Closed Thread