Question:
how to create an object to a class present in a dll ?
?
2007-08-14 05:44:07 UTC
In my VC++ win32 application,I was successful in loading a dll and also successful in using the methods of it directly.

But my present problem lies in creating objects to the classes that are present in that dll and accessing the methods in that class through the created object.

kindly provide me any sample code which does this.

thnx in advance.

Regards,
sunny.
Three answers:
cruppstahl
2007-08-14 06:28:33 UTC
i think the proper way to do this is to export only a factory function in the DLL, not the class itself.



DLLEXPORT myclass *factory();



myclass *factory()

{

return new myclass;

}



in your application, load the dll, load the factory-function and use it to create the object.
kikelia
2016-11-12 12:16:34 UTC
there is no longer something he can do. As I wrote until now, even after springing up the plagues of egypt, parting the crimson sea, offering manna from the sky (a in common terms heavenly substance that may no longer something extra advantageous than a miracle each and on a daily basis) to maintain them alive as they journeyed and being the religion of the Jews that they have consistently observed- after all that, the Jewish human beings nevertheless lost their faith after a loss of Moses and melted their gold right into a golden calf to worship! How ought to they experience forsaken after lots! How ought to they lose faith and deny God? THEM! that they had extra evidence than anyone ought to ever ask for. And in the event that they could act that way, then there isn't any information that God ought to ever grant, different than turning us into pillars of salt and obvious at us interior the afterlife, which will ever "teach" his existence to human beings. So provide up irritating approximately evidence. faith is the only way.
anonymous
2007-08-14 05:59:53 UTC
read this article ...



http://www.codeproject.com/dll/SimpleDll2.asp



your class in dll is written with C++ of microsoft or another environment?


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...