Re: Boost Digest, Vol 935, Issue 2

extern "C" Interface* DLLCreate() { return new InterfaceImpl; }
extern "C" void DLLDestroy( Interface* p ) { delete p; }
and then construct an InterfacePtr( DLLCreate(), DLLDestroy ). You'll need a public virtual destructor in this case, though.
I changed to this: void DLLCreate( Interface& rInterface ) { // Implementation option #1: rInterface.reset( new InterfaceImple ); // Implementation option #2: rInterface = InterfacePtr( new InterfaceImpl ); } Is this a valid solution as well? At least it compiles - but with the first solution I have the feeling that I could run into the boundary problem, since the actual pointer is not constructed on the DLL side. But as I said - I can only guess here... Is there a difference between both solutions?
Yes, it's allowed. Since you are using the DLL runtime, you probably don't need to interoperate with different C++ compilers so you probably need to just omit the extern "C" from DLLCreate. But how can I load the function than after it got mangled?

Dirk Gregorius wrote:
extern "C" Interface* DLLCreate() { <snip>
From http://www.boost.org/more/discussion_policy.htm#quoting
Do not reply to digests if you are a digest delivery subscriber. Your reply will not be properly threaded and will probably have the wrong subject line. Instead, you can reply through the GMane web interface. Thanks, -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (2)
-
David Abrahams
-
Dirk Gregorius