Re: member function level dll export
Thanks for the quick response.
I impelement them in a class CFoo that inherits from IFoo, so the
functions are defined there.
Your answer explains why I don't see them in depends, but not why when
I call into this dll from an app, it makes it into the appropriate
function.
in my app:
IFoo * pFoo = Factory::CreateFoo();
pFoo->Func1();
Factory is a class in my dll too.
CreateFoo is a static member func that internally news a CFoo, and
returns a casted pointer to IFoo.
When I call pFoo->Func1() it does make it into CFoo::Func1(). How does
it jump into the dll?
thanks,
Eric
On Apr 24, 3:52 pm, "Doug Harrison [MVP]" <d...@mvps.org> wrote:
On Thu, 24 Apr 2008 12:40:18 -0700 (PDT), qdin <eryq...@gmail.com> wrote:
Hi.
I was wondering how member function level dll exporting works.
I have an interface, and before each function I put the
declspec(dllexport) tag,
and then I implement this class in CFoo, without the declspec tag.
I compile this into a dll, and everything works fine (I can call each
function properly etc).
But when I run this dll through depends.exe, or dumpbin.exe with the /
EXPORTS flag,
nothing shows up (only static functions show up).
How is it doing this linking?
Thanks in advance,
Eric
#define DLLEXPORT __declspec(dllexport)
struct IFoo
{
virtual DLLEXPORT Func1()=0;
virtual DLLEXPORT Func2()=0;
virtual DLLEXPORT Func3()=0;
}
They don't show up in depends because you don't define them. Give these
pure virtual functions bodies, and they will show up in depends. Of course,
you normally wouldn't define pure virtual functions in the class that
introduces them, and thus, there's no reason to dllexport them.
--
Doug Harrison
Visual C++ MVP