这篇教程C++ GetObjectA函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetObjectA函数的典型用法代码示例。如果您正苦于以下问题:C++ GetObjectA函数的具体用法?C++ GetObjectA怎么用?C++ GetObjectA使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetObjectA函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: test_ifont_size/* Various checks along the way. */static void test_ifont_size(LONG lo_size, LONG hi_size, LONG ratio_logical, LONG ratio_himetric, LONG hfont_height, const char * test_name){ FONTDESC fd; LPVOID pvObj = NULL; IFont* ifnt = NULL; HFONT hfont; LOGFONTA lf; CY psize; HRESULT hres; DWORD rtnval; fd.cbSizeofstruct = sizeof(FONTDESC); fd.lpstrName = arial_font; /* using scalable instead of bitmap font reduces errors due to font realization */ S(fd.cySize).Lo = lo_size; S(fd.cySize).Hi = hi_size; fd.sWeight = 0; fd.sCharset = 0; fd.fItalic = FALSE; fd.fUnderline = FALSE; fd.fStrikethrough = FALSE; /* Create font, test that it worked. */ hres = pOleCreateFontIndirect(&fd, &IID_IFont, &pvObj); ifnt = pvObj; ok(hres == S_OK,"%s: OCFI returns 0x%08x instead of S_OK./n", test_name, hres); ok(pvObj != NULL,"%s: OCFI returns NULL./n", test_name); /* Change the scaling ratio */ hres = IFont_SetRatio(ifnt, ratio_logical, ratio_himetric); ok((ratio_logical && ratio_himetric) ? hres == S_OK : hres == E_FAIL, "%s: IFont_SetRatio unexpectedly returned 0x%08x./n", test_name, hres); /* Read back size. */ hres = IFont_get_Size(ifnt, &psize); ok(hres == S_OK,"%s: IFont_get_size returns 0x%08x instead of S_OK./n", test_name, hres); /* Check returned size - allow for errors due to rounding & font realization. */ ok((abs(S(psize).Lo - lo_size) < 10000) && S(psize).Hi == hi_size, "%s: IFont_get_Size: Lo=%d, Hi=%d; expected Lo=%d, Hi=%d./n", test_name, S(psize).Lo, S(psize).Hi, lo_size, hi_size); /* Check hFont size. */ hres = IFont_get_hFont (ifnt, &hfont); ok(hres == S_OK, "%s: IFont_get_hFont returns 0x%08x instead of S_OK./n", test_name, hres); rtnval = GetObjectA(hfont, sizeof(LOGFONTA), &lf); ok(rtnval > 0, "GetObject(hfont) failed/n"); /* Since font scaling may encounter rounding errors, allow 1 pixel deviation. */ ok(abs(lf.lfHeight - hfont_height) <= 1, "%s: hFont has lf.lfHeight=%d, expected %d./n", test_name, lf.lfHeight, hfont_height); /* Free IFont. */ IFont_Release(ifnt);}
开发者ID:Strongc,项目名称:reactos,代码行数:61,
示例2: cdtInit/*********************************************************************** * Initializes the cards.dll library. Loads the card bitmaps from the * resources, and initializes the card size variables. */BOOL WINAPI cdtInit(int *width, int *height){ BITMAP bm; int i; TRACE("(%p, %p)/n", width, height); for(i = 0; i <= CARD_MAX; i++) cardBitmaps[i] = 0; for(i = 0; i <= CARD_MAX; i++) { cardBitmaps[i] = LoadBitmapA(hInst, MAKEINTRESOURCEA(i)); if(cardBitmaps[i] == 0) { cdtTerm(); return FALSE; } } GetObjectA(cardBitmaps[0], sizeof(BITMAP), &bm); *width = cardWidth = bm.bmWidth; *height = cardHeight = bm.bmHeight; return TRUE;}
开发者ID:AlexSteel,项目名称:wine,代码行数:29,
|