Hi! I started learning to build DLLs, and I discovered something that I find weird. Probably other people have realised this already, or maybe my compiler is just doing funny things... Well, here's what I came across. I built a little dll for learning purposes and inside of it, I exported a class, so that I could test it in another app where I'd import the test dll with its header files. So in the test app, I saw that I could remove the "private:" tags and replace them with "public:" giving me direct access to everything in the class... Then my app would compile fine even if I tried to access private data that should be hidden in the dll... That means that if you give the dll to someone, he'll be able to mess with it? Shouldn't functions and variables names decoration also decorate the public/private tag? Maybe I am getting confused with all data protection thing...
Would that also mean that users could add new functions to your classes, having tweaked your header files and building their new functions definitions too?
Code://Class's header as compiled in the DLL class foo { private: int data; }; //You gave your headers to someone then he messed with it class foo { public: int data; };