Get IFontDisp type information from stdole2.tlb, instead of IDispatch
information from stdole32.tlb.
This commit is contained in:
parent
bfb04ad7c0
commit
d765cb960f
|
@ -1235,7 +1235,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
|
|||
LCID lcid,
|
||||
ITypeInfo** ppTInfo)
|
||||
{
|
||||
static const WCHAR stdole32tlb[] = {'s','t','d','o','l','e','3','2','.','t','l','b',0};
|
||||
static const WCHAR stdole2tlb[] = {'s','t','d','o','l','e','2','.','t','l','b',0};
|
||||
ITypeLib *tl;
|
||||
HRESULT hres;
|
||||
|
||||
|
@ -1243,12 +1243,12 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
|
|||
TRACE("(%p, iTInfo=%d, lcid=%04x, %p)\n", this, iTInfo, (int)lcid, ppTInfo);
|
||||
if (iTInfo != 0)
|
||||
return E_FAIL;
|
||||
hres = LoadTypeLib(stdole32tlb, &tl);
|
||||
hres = LoadTypeLib(stdole2tlb, &tl);
|
||||
if (FAILED(hres)) {
|
||||
ERR("Could not load the stdole32.tlb?\n");
|
||||
ERR("Could not load the stdole2.tlb?\n");
|
||||
return hres;
|
||||
}
|
||||
hres = ITypeLib_GetTypeInfoOfGuid(tl, &IID_IDispatch, ppTInfo);
|
||||
hres = ITypeLib_GetTypeInfoOfGuid(tl, &IID_IFontDisp, ppTInfo);
|
||||
if (FAILED(hres)) {
|
||||
FIXME("Did not IDispatch typeinfo from typelib, hres %lx\n",hres);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#include <float.h>
|
||||
#include <time.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include <wine/test.h>
|
||||
#include <windef.h>
|
||||
#include <winbase.h>
|
||||
|
@ -33,9 +35,7 @@
|
|||
#include <winnls.h>
|
||||
#include <winerror.h>
|
||||
#include <winnt.h>
|
||||
|
||||
#include <wtypes.h>
|
||||
#define COBJMACROS
|
||||
#include <olectl.h>
|
||||
|
||||
static HMODULE hOleaut32;
|
||||
|
@ -131,6 +131,34 @@ void test_QueryInterface(void)
|
|||
IFont_Release(font);
|
||||
}
|
||||
|
||||
void test_type_info(void)
|
||||
{
|
||||
LPVOID pvObj = NULL;
|
||||
HRESULT hres;
|
||||
IFontDisp* fontdisp = NULL;
|
||||
ITypeInfo* pTInfo;
|
||||
WCHAR name_Name[] = {'N','a','m','e',0};
|
||||
BSTR names[3];
|
||||
UINT n;
|
||||
LCID en_us = MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),
|
||||
SORT_DEFAULT);
|
||||
|
||||
pOleCreateFontIndirect(NULL, &IID_IFontDisp, &pvObj);
|
||||
fontdisp = pvObj;
|
||||
|
||||
hres = IFontDisp_GetTypeInfo(fontdisp, 0, en_us, &pTInfo);
|
||||
ok(hres == S_OK, "GTI returned 0x%08lx instead of S_OK.\n", hres);
|
||||
ok(pTInfo != NULL, "GTI returned NULL.\n");
|
||||
|
||||
hres = ITypeInfo_GetNames(pTInfo, DISPID_FONT_NAME, names, 3, &n);
|
||||
ok(hres == S_OK, "GetNames returned 0x%08lx instead of S_OK.\n", hres);
|
||||
ok(n == 1, "GetNames returned %d names instead of 1.\n", n);
|
||||
ok(!lstrcmpiW(names[0],name_Name), "DISPID_FONT_NAME doesn't get 'Names'.\n");
|
||||
|
||||
ITypeInfo_Release(pTInfo);
|
||||
IFontDisp_Release(fontdisp);
|
||||
}
|
||||
|
||||
START_TEST(olefont)
|
||||
{
|
||||
hOleaut32 = LoadLibraryA("oleaut32.dll");
|
||||
|
@ -139,6 +167,7 @@ START_TEST(olefont)
|
|||
return;
|
||||
|
||||
test_QueryInterface();
|
||||
test_type_info();
|
||||
|
||||
/* Test various size operations and conversions. */
|
||||
/* Add more as needed. */
|
||||
|
|
Loading…
Reference in New Issue