HRESULT getProperty(
const wchar_t* pwchName,
VARIANT* pvarValue
);
Notice the type of pwchName. It's type is const wchar_t* which should be const WideString but as you can see after importing the type library you get:
function getProperty(var pwchName: Word;
out pvarValue: OleVariant): HResult; stdcall;
Obviously the codegen is wrong but why is that. If you take a look at the .tlb in Ole View or the Type Library Editor you'll notice the following IDL:
HRESULT _stdcall getProperty(
[in] unsigned short* pwchName,
[out, retval] VARIANT* pvarValue);
Notice the unsigned short*. The type library importer generated it as a var Word. This means the type library is doing exactly what it should be doing.
So either the documentation is incorrect or the .tlb is incorrect.
No comments:
Post a Comment