Mixing native OLE with MFC interface/wrappers
-
Hi, I have noticed that certain OLE functions dont have MFC wrappers one in particaular Is OpenText I have noticed also that it seems that for those functions that dont have MFC wrappers, they use a generic AUTOWRAP function Which is base on native OLE functions such as IDispatch I have intlized OLE using MFC/Framework AfxOleInit to use native ole functions would I have to do intilzations twice e.g. CoInitlize(NULL) and then CoCreateInstance I need MFC as I would like use Windows Service in this program Please Advise Thanks
-
Hi, I have noticed that certain OLE functions dont have MFC wrappers one in particaular Is OpenText I have noticed also that it seems that for those functions that dont have MFC wrappers, they use a generic AUTOWRAP function Which is base on native OLE functions such as IDispatch I have intlized OLE using MFC/Framework AfxOleInit to use native ole functions would I have to do intilzations twice e.g. CoInitlize(NULL) and then CoCreateInstance I need MFC as I would like use Windows Service in this program Please Advise Thanks
You don't need to call CoInitialize() again. You will need to check to see if the MFC interfaces are dual or not. If they are you can use then as if that are non-automation interfaces. I.e. just go obj->SomeMethod(); My guess is probably not, in which case you will have to use IDispatch->Invoke(...) which is a real pain. I'm sure you can find helper code out there on the Web.