- Sep 10, 2005
- 7,458
- 1
- 76
Assuming C++..
I'm trying to figure out what the ideal path is for splitting up code into DLLs. It seems like .net or COM are the way to go. However, COM seems to limit your inputs and outputs to windows specific types. However, I feel like I always want to pass my own user-defined types to a DLL. Is there a common practice ppl use to completely avoid passing user-defined types?
A route people used in the past is to create pure virtual interfaces and hand that off to whoever wanted to use the DLL. The DLL only has a few functions like GetHandle, GetVersion, ReleaseHandle which basically gives creates an instance of the object you want and returns a void pointer to it. You cast that pointer yourself into the object with the pure virtual class defined in the header file. However, the DLL has to implement a whole bunch of things which COM conveniently takes care of. I find it hard to believe that COM is popular though because it is kind of complicated. What is the most common route for splitting up code into DLLs?
Currently looking into doom3 source code to see if I can find any hints..
I'm trying to figure out what the ideal path is for splitting up code into DLLs. It seems like .net or COM are the way to go. However, COM seems to limit your inputs and outputs to windows specific types. However, I feel like I always want to pass my own user-defined types to a DLL. Is there a common practice ppl use to completely avoid passing user-defined types?
A route people used in the past is to create pure virtual interfaces and hand that off to whoever wanted to use the DLL. The DLL only has a few functions like GetHandle, GetVersion, ReleaseHandle which basically gives creates an instance of the object you want and returns a void pointer to it. You cast that pointer yourself into the object with the pure virtual class defined in the header file. However, the DLL has to implement a whole bunch of things which COM conveniently takes care of. I find it hard to believe that COM is popular though because it is kind of complicated. What is the most common route for splitting up code into DLLs?
Currently looking into doom3 source code to see if I can find any hints..