Commit d765cb96 authored by Walt Ogburn's avatar Walt Ogburn Committed by Alexandre Julliard

Get IFontDisp type information from stdole2.tlb, instead of IDispatch

information from stdole32.tlb.
parent bfb04ad7
...@@ -1235,7 +1235,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo( ...@@ -1235,7 +1235,7 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
LCID lcid, LCID lcid,
ITypeInfo** ppTInfo) 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; ITypeLib *tl;
HRESULT hres; HRESULT hres;
...@@ -1243,12 +1243,12 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo( ...@@ -1243,12 +1243,12 @@ static HRESULT WINAPI OLEFontImpl_GetTypeInfo(
TRACE("(%p, iTInfo=%d, lcid=%04x, %p)\n", this, iTInfo, (int)lcid, ppTInfo); TRACE("(%p, iTInfo=%d, lcid=%04x, %p)\n", this, iTInfo, (int)lcid, ppTInfo);
if (iTInfo != 0) if (iTInfo != 0)
return E_FAIL; return E_FAIL;
hres = LoadTypeLib(stdole32tlb, &tl); hres = LoadTypeLib(stdole2tlb, &tl);
if (FAILED(hres)) { if (FAILED(hres)) {
ERR("Could not load the stdole32.tlb?\n"); ERR("Could not load the stdole2.tlb?\n");
return hres; return hres;
} }
hres = ITypeLib_GetTypeInfoOfGuid(tl, &IID_IDispatch, ppTInfo); hres = ITypeLib_GetTypeInfoOfGuid(tl, &IID_IFontDisp, ppTInfo);
if (FAILED(hres)) { if (FAILED(hres)) {
FIXME("Did not IDispatch typeinfo from typelib, hres %lx\n",hres); FIXME("Did not IDispatch typeinfo from typelib, hres %lx\n",hres);
} }
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include <float.h> #include <float.h>
#include <time.h> #include <time.h>
#define COBJMACROS
#include <wine/test.h> #include <wine/test.h>
#include <windef.h> #include <windef.h>
#include <winbase.h> #include <winbase.h>
...@@ -33,9 +35,7 @@ ...@@ -33,9 +35,7 @@
#include <winnls.h> #include <winnls.h>
#include <winerror.h> #include <winerror.h>
#include <winnt.h> #include <winnt.h>
#include <wtypes.h> #include <wtypes.h>
#define COBJMACROS
#include <olectl.h> #include <olectl.h>
static HMODULE hOleaut32; static HMODULE hOleaut32;
...@@ -131,6 +131,34 @@ void test_QueryInterface(void) ...@@ -131,6 +131,34 @@ void test_QueryInterface(void)
IFont_Release(font); 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) START_TEST(olefont)
{ {
hOleaut32 = LoadLibraryA("oleaut32.dll"); hOleaut32 = LoadLibraryA("oleaut32.dll");
...@@ -139,6 +167,7 @@ START_TEST(olefont) ...@@ -139,6 +167,7 @@ START_TEST(olefont)
return; return;
test_QueryInterface(); test_QueryInterface();
test_type_info();
/* Test various size operations and conversions. */ /* Test various size operations and conversions. */
/* Add more as needed. */ /* Add more as needed. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment