Re: [libxml++] MS Visual 2005 - Return object across DLLboundary? (Was: Another issue)



> This looks the annoying MSVC++ requirement that memory is 
> deallocated in the same library (DLL) in which it was 
> allocated. So, if a library gives you a newly allocated 
> object, you can't delete it yourself. You have to tell the 
> library to delete it.  libsigc++ used to have this same problem.
> 
> You can usually fix this by making sure that, though the 
> deletion is initiated in the caller, the actual deletion 
> happens in some function in the library. Which would require a patch.

To my understanding, there is another way to acheive this :

If you select the Multi-threaded DLL (/MD) options, all allocations/deallocations, either from the main program or from the DLL are delegated to yet another DLL (MSVCR80.DLL) (which must then  be delivered with the program), and thus happen in a unique place.

Of course, the main program and all its DLL should be compile with the same option.

-- 
Loïc






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]