Re: exportdll DLL
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Wed, 26 Jul 2006 23:42:45 -0500
On 26 Jul 2006 19:33:22 -0700, "Ajay Kalra" <ajaykalra@xxxxxxxxx> wrote:
I dont know how that will happen. If CMetadata is not exported, there
will be a link time failure as the client DLL will not be able to find
the class in any of the libraries its linking against. I guess the only
way it can succeed is if you force a compile (not recommended)
regardless.
I did say I couldn't explain the OP's observation unless one of the two
scenarios I listed applied. :) What I said about "inline" was a bit of a
stretch, since an inline function doesn't really belong to any module; I
guess I thought of it because the header it appears in is considered part
of the module's interface. The virtual function issue is more interesting.
Suppose you have the OP's class CMetaData:
class CMetaData
{
public:
virtual void f();
};
Per the OP's message, another class X (presumably exported) creates a
CMetaData and returns a pointer to it to another module. Now that other
module can call p->f(), even though CMetaData::f isn't exported. What it
can't do is say p->CMetaData::f(), because that disables the virtual call
mechanism and causes the compiler to bind to f's actual address. So, the
OP's observation could be explained if the CMetaData::GetValue in his
actual code is a virtual function.
--
Doug Harrison
Visual C++ MVP
.
- Follow-Ups:
- Re: exportdll DLL
- From: Ajay Kalra
- Re: exportdll DLL
- References:
- exportdll DLL
- From: jean
- Re: exportdll DLL
- From: Doug Harrison [MVP]
- Re: exportdll DLL
- From: Ajay Kalra
- Re: exportdll DLL
- From: Doug Harrison [MVP]
- Re: exportdll DLL
- From: Ajay Kalra
- exportdll DLL
- Prev by Date: Re: Question of newbie: why an Avs occurs?
- Next by Date: Re: Random question: Can you save bookmarks in VC6?
- Previous by thread: Re: exportdll DLL
- Next by thread: Re: exportdll DLL
- Index(es):
Relevant Pages
|