MFC COM dll
-
Hi When i create a MFC DLL with Automation option selected, wizard creates some functions for me. For example DllGetClassObject, DllRegisterServer If i add second com class to my dll, how must i change the CoGetClassObject, DllRegisterServer code? I see all the sample codes are about one class in one dll. i dont know what must be done if i want to add more than one class. Also i wonder this: If one dll contains 3 com class, it means there are 3 servers in one dll?
-
Hi When i create a MFC DLL with Automation option selected, wizard creates some functions for me. For example DllGetClassObject, DllRegisterServer If i add second com class to my dll, how must i change the CoGetClassObject, DllRegisterServer code? I see all the sample codes are about one class in one dll. i dont know what must be done if i want to add more than one class. Also i wonder this: If one dll contains 3 com class, it means there are 3 servers in one dll?
It's hard to explain COM in a small book let a lone in a short post so the best thing I can do is say try it and see. Try creating 3 separate Dlls, one object in each with the wizard and see where the code is the same and where it's different and if you can combine them manually. Also the theory of COM is different from the implementation of COM objects within a framework like MFC or ATL. Framework implementation details like COM Maps can be very confusing if you don't already understand what they're trying to achieve. Learning by fiddling has always been the best way to learn programming and not just because that's how I did it.:-D
Nothing is exactly what it seems but everything with seems can be unpicked.