Iam new to making dlls in C++ (native dlls), I did create dlls using C#/VB.net which is entirely a different process from creating dlls in C++.
what i found that there are many ways to export a class so that you can use the methods in it in another applications (C++ or .net applications or both).
ways that i have found are by using an interface, using loadlibrary and malloc, using wrapper class (C++/CLI) and finally the old C way by exporting bridge methods (extern "C").
I dont want to learn all of them. what i want is someone to tell me how every way will end up on the client side so that i can decide which way to choose. for example if I went with the C approach (extern "C" functions) on the client side the usage will require passing the object created by the factory method as a parameter to the exported method. maybe providing a segment of the client code for each way will be nice...
What I really hope for is making a dll (or two dll files native + CLI) that the developers can use at the end as if they are using a class defined by their code, like this ClassName.Method() or CLassName->Method() for C++
You just have to define the "MAKING_DLL" macro when you compile the DLL and make sure that whatever name you choose instead of "MAKING_DLL" won't be defined as a macro by your dll's clients.
Of course you'll have to provide the class header with the DLL.
what about name mangling or what ever it is called... will providing the class header help in that? also if lets say I made a wrapper class in CLI/C++ and included the header file from my native class... do i need to include the header file for my class so that .net developers can use my class? like do they need to extract some info from it in order to use the class? or is giving them only the two dlls (native + wrapper) enough...
ah cant decide, tell me toum if you were in my place, and you want to distribute a class so that it can be used by both developers (C++ and .net) how would you do it?
finally... thank you very much for your help toum.