Connecting Tech Pros Worldwide Help | Site Map

How do I use classes from a DLL?

  #1  
Old July 19th, 2005, 06:28 PM
Jake D
Guest
 
Posts: n/a
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?
  #2  
Old July 19th, 2005, 06:28 PM
Alf P. Steinbach
Guest
 
Posts: n/a

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>

  #3  
Old July 19th, 2005, 06:28 PM
shakahshakah@yahoo.com
Guest
 
Posts: n/a

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]
  #4  
Old July 19th, 2005, 06:28 PM
Kevin Goodsell
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
inheriting classes from VC++6 into C#.net Amu answers 2 January 17th, 2007 05:25 AM
Exceptions from DLL in ASPX page Steve answers 5 November 19th, 2005 07:26 PM
question - using classes from a DLL Jake D answers 6 July 19th, 2005 06:59 PM
Loading classes from DLL harkeman answers 1 July 19th, 2005 03:59 PM