I have a c++ com code with source code now want i want to do is use the public class of that source code in my project( similarly the way in which we can add dll in c# and get acces to public class) .The class are not exported also is it necessary to export public class in c++

If you have all the source code then just export it and recompile. Put the class in a *.h file and include it in the application *.cpp file like you would any other header file, then at link time link with the *.lib file that's created when you compiled the class.

Or a simpler way is to just add the class as another file in your project. No need for a dll or *.lib that way. But be careful to give full credit to the original autor by putting his/her name in comments at the top of that class file. If you don't you could be accuses of plagurism.

If you have all the source code then just export it and recompile. Put the class in a *.h file and include it in the application *.cpp file like you would any other header file, then at link time link with the *.lib file that's created when you compiled the class.

Or a simpler way is to just add the class as another file in your project. No need for a dll or *.lib that way. But be careful to give full credit to the original autor by putting his/her name in comments at the top of that class file. If you don't you could be accuses of plagurism.

Thanx for you replay any way the code is by microsoft and i would preferabley not like to addd anything on the existing code so i the way in which i could do is to achieve by using like dll.
Now in order to add export it i would have to do changes in the third party code which i cant do.
I would like(it is requied) it to be modular the the code as it is without adding anything on the third party code what ever i do i have to do on my side any idea

This article has been dead for over six months. Start a new discussion instead.