On Wed, 14 Sep 2005, Robert Shearman wrote:
You're not being lazy enough. All of this stuff can be easily implemented in one go using CreateStdDispatch, as long as you know how to use it. Try the attached patch.
Changelog: Return the standard font IDispatch interface created using CreateStdDispatch on top of a typelib instead of manually implementing the necessary methods.
Hi Robert,
I'm not sure how to proceed here. My small patch makes the GetIDsOfNames in olefont work, so that programs that want to use GetIDsOfNames to get a DISPID code and then use Invoke to set font size, bold, etc. will work. With your bigger patch, IFontDisp uses the GetIDsOfNames from typelib.c, which also works, but it also uses the Invoke from typelib.c, which doesn't know how to set the font size, etc. Therefore, programs that try to get the DISPID code with GetIDsOfNames and then set some property with Invoke are broken at a different point after your patch.
The thing is, I don't see how the Invoke in typelib.c can be made to get and set the font size, font weight, etc. correctly. It shouldn't know about the internal structure of OLEFontImpl, right? So how can it know that DISPID_FONT_WEIGHT and DISPID_FONT_BOLD mean doing doing different things to the same field in the OLEFontImpl, or where to find it?
If you know how to make Invoke work again after your patch, that would be great. Otherwise, I could just re-submit my patch with the error handling corrected as Alexandre said.
- Walter