Boost logo

Boost :

Subject: Re: [boost] boost::shared_ptr and serialization
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-11-28 11:31:11


Klaus - Peter Weber wrote:
> Hi,
> For the CTest class is not exported and not accessible directly from
> out of the shared lib, an interface is provided :
>
> MY_DLL_EXPORT_MACRO ICTest* CreateCTestClassInstance( void)
> {
> return new CTest();
> }
> typedef boost::shared_ptr<ICTest> pICTest;
>
>
> Instantiating the interface in my program and using CTest class
> instance:
>
> pICTest p1( CreateCTestClassInstance());
> p1->setI( 1);
>
> works fine, so far so good. A Problem occures when I try to serialize
> CTest class like :
>

Look at the documentation under serialization of pointers, export, etc.
look at the sample applications demo_plugins and others.

This should help

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk