DLL plugins - what can I pass across the boundary

Started by
1 comment, last by Aardvajk 12 years, 1 month ago
Hello all,

Just thinking about adding future plugin support to a 3D modelling program I've been working on and I've discovered that it is hard to research and find out exactly what I can pass across the boundary between my app and the DLL.

I've heard that passing standard containers is a no-no, presumably because of the potential differences in memory allocation when the template is compiled into the DLL. What I was wondering is is it safe to still use this stuff as long as it is wrapped inside a static lib that the application and the DLL both link to?

So my lib would present a class with access methods for adding vertices and removing them, say, which internally inside the lib is done via manipulating vectors. But the client code just uses the methods of the class and a PIMPL idiom is used to prevent the .h from needing to include <vector>.

Is this now okay? I'd presume so because the vector is only compiled into the lib but I'm really not too sure.

Thanks.
Advertisement

What I was wondering is is it safe to still use this stuff as long as it is wrapped inside a static lib that the application and the DLL both link to?


If your static lib ever changes or needs to be re-compiled you are facing the same problems.
Ah, I see. Because then the code linked into the DLL and the code linked into the application would be different.

Hmm, okay. Need a rethink. Thanks for the input.

This topic is closed to new replies.

Advertisement