Quote Originally Posted by Bubba View Post
This code is suspect.

1. You are passing in pointers to objects you did not create in the DLL. Who is cleaning these up? I hope you understand that the vector in the DLL cannot clean these up or you will corrupt the heap.
2. You are using the STL in DLLs. This can be problematic if you are not careful. You cannot expose any portion of the STL at the DLL interface...or what I would call the module boundary. If you do you will get the exact error your post is about.
3. In addToList you are not checking to make sure that the Device pointer is valid prior to using it. What if the pointer is null? Your code will crash.
4. Your function is called addToList() however I do not see anywhere in the function where the pointer is added to any list or vector.
I am SO glad to leave these limitations behind. This is why I will only do Windows coding anymore if it means feeding my family or starving.