当前位置: 首页>>代码示例>>C++>>正文


C++ GetObjectType函数代码示例

本文整理汇总了C++中GetObjectType函数的典型用法代码示例。如果您正苦于以下问题:C++ GetObjectType函数的具体用法?C++ GetObjectType怎么用?C++ GetObjectType使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetObjectType函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: InitializeOneFont

void InitializeOneFont (HFONT * theFont, 
                               const TCHAR FontRegKey[] , 
                               LOGFONT autoLogFont, 
                               LOGFONT * LogFontUsed)
{
  LOGFONT logfont;
  if (GetObjectType(*theFont) == OBJ_FONT) {
    DeleteObject(*theFont); // RLD the EditFont screens use the Delete
  }

  memset ((char *)&logfont, 0, sizeof (LOGFONT));

  if (UseCustomFonts) {
    propGetFontSettings((TCHAR * )FontRegKey, &logfont);
    if (!IsNullLogFont(logfont)) {
      *theFont = CreateFontIndirect (&logfont);
      if (GetObjectType(*theFont) == OBJ_FONT) {
        if (LogFontUsed != NULL) *LogFontUsed = logfont; // RLD save for custom font GUI
      }
    }
  }

  if (GetObjectType(*theFont) != OBJ_FONT) {
    if (!IsNullLogFont(autoLogFont)) {
      ApplyClearType(&autoLogFont);
      ApplyFontSize(&autoLogFont);
      *theFont = CreateFontIndirect (&autoLogFont);
      if (GetObjectType(*theFont) == OBJ_FONT) {
        if (LogFontUsed != NULL) *LogFontUsed = autoLogFont; // RLD save for custom font GUI
      }
    }
  }
}
开发者ID:Acrobot,项目名称:LK8000,代码行数:33,代码来源:Fonts.cpp

示例2: test_thread_objects

static void test_thread_objects(void)
{
    LOGPEN lp;
    DWORD tid, type;
    HANDLE hthread;
    struct hgdiobj_event hgdiobj_event;
    INT ret;
    DWORD status;
    BOOL bRet;

    hgdiobj_event.stop_event = CreateEventA(NULL, 0, 0, NULL);
    ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %u\n", GetLastError());
    hgdiobj_event.ready_event = CreateEventA(NULL, 0, 0, NULL);
    ok(hgdiobj_event.ready_event != NULL, "CreateEvent error %u\n", GetLastError());

    hthread = CreateThread(NULL, 0, thread_proc, &hgdiobj_event, 0, &tid);
    ok(hthread != NULL, "CreateThread error %u\n", GetLastError());

    status = WaitForSingleObject(hgdiobj_event.ready_event, INFINITE);
    ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError());

    ret = GetObjectA(hgdiobj_event.hgdiobj1, sizeof(lp), &lp);
    ok(ret == sizeof(lp), "GetObject error %u\n", GetLastError());
    ok(lp.lopnStyle == PS_DASHDOTDOT, "wrong pen style %d\n", lp.lopnStyle);
    ok(lp.lopnWidth.x == 17, "wrong pen width.y %d\n", lp.lopnWidth.x);
    ok(lp.lopnWidth.y == 0, "wrong pen width.y %d\n", lp.lopnWidth.y);
    ok(lp.lopnColor == RGB(1, 2, 3), "wrong pen width.y %08x\n", lp.lopnColor);

    ret = GetDeviceCaps(hgdiobj_event.hdc, TECHNOLOGY);
    ok(ret == DT_RASDISPLAY, "GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d\n", ret);

    bRet = DeleteObject(hgdiobj_event.hgdiobj1);
    ok(bRet, "DeleteObject error %u\n", GetLastError());
    bRet = DeleteDC(hgdiobj_event.hdc);
    ok(bRet, "DeleteDC error %u\n", GetLastError());

    type = GetObjectType(hgdiobj_event.hgdiobj2);
    ok(type == OBJ_REGION, "GetObjectType returned %u\n", type);

    SetEvent(hgdiobj_event.stop_event);
    status = WaitForSingleObject(hthread, INFINITE);
    ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError());
    CloseHandle(hthread);

    type = GetObjectType(hgdiobj_event.hgdiobj2);
    ok(type == OBJ_REGION, "GetObjectType returned %u\n", type);
    bRet = DeleteObject(hgdiobj_event.hgdiobj2);
    ok(bRet, "DeleteObject error %u\n", GetLastError());

    CloseHandle(hgdiobj_event.stop_event);
    CloseHandle(hgdiobj_event.ready_event);
}
开发者ID:iXit,项目名称:wine,代码行数:52,代码来源:gdiobj.c

示例3: ParseSolidObject

int LuaObjectRenderingImpl::SetPieceList(lua_State* L)
{
	CSolidObject* obj = ParseSolidObject(L, __FUNCTION__, 1, GetObjectType());

	if (obj == nullptr)
		return 0;

	const LuaObjectMaterialData* lmd = obj->GetLuaMaterialData();
	LocalModelPiece* lmp = ParseObjectLocalModelPiece(L, obj, 3);

	if (lmp == nullptr)
		return 0;

	const unsigned int lod = luaL_checknumber(L, 2) - 1;

	if (lod >= lmd->GetLODCount())
		return 0;

	// (re)set the default if no fourth argument
	unsigned int dlist = lmp->dispListID;

	if (lua_isnumber(L, 4)) {
		CLuaDisplayLists& displayLists = CLuaHandle::GetActiveDisplayLists(L);
		dlist = displayLists.GetDList(luaL_checknumber(L, 4));
	}

	lmp->lodDispLists[lod] = dlist;
	return 0;
}
开发者ID:Liuyangbiao,项目名称:spring,代码行数:29,代码来源:LuaObjectRendering.cpp

示例4: GDISelectPalette

/***********************************************************************
 *           GDISelectPalette    (Not a Windows API)
 */
HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg)
{
    HPALETTE ret = 0;
    DC *dc;

    TRACE("%p %p\n", hdc, hpal );

    hpal = get_full_gdi_handle( hpal );
    if (GetObjectType(hpal) != OBJ_PAL)
    {
      WARN("invalid selected palette %p\n",hpal);
      return 0;
    }
    if ((dc = get_dc_ptr( hdc )))
    {
        PHYSDEV physdev = GET_DC_PHYSDEV( dc, pSelectPalette );
        ret = dc->hPalette;
        if (physdev->funcs->pSelectPalette( physdev, hpal, FALSE ))
        {
            dc->hPalette = hpal;
            if (!wBkg) hPrimaryPalette = hpal;
        }
        else ret = 0;
        release_dc_ptr( dc );
    }
    return ret;
}
开发者ID:AlexSteel,项目名称:wine,代码行数:30,代码来源:palette.c

示例5: P_Member

// MEMBER      -> [ OBJECT s_dot ] <
//                k_type | k_name | k_attrib | k_version | k_uuid | k_uunm |
//                k_clsid | k_iid | k_value >
//
int P_Member(LubeToken token)
{
    ObjectType object;
    MemberType member;
    PSTATEDESC pDesc;

    if (IsObjectToken(token)) {
        object = GetObjectType(token);
        if (Object_None == object) object = s_pContext->m_curObject;

        if (_PeekToken() != Token_S_dot) {
            ErrorReport(Lube_E_InvalidMember, g_szCurrentToken);
            return Ret_Continue;
        }
        _GetToken(); // skip s_dot
        token = _GetToken();
    }
    else {
        object = s_pContext->m_curObject;
    }

    member = GetMemberType(object, token);
    if (Member_None == member) return Ret_Continue;

    pDesc = s_pContext->CreateBlockette(State_Member);
    if (!pDesc) {
        ErrorReport(Lube_E_OutOfMemory);
        return Ret_AbortOnError;
    }
    pDesc->object = object;
    pDesc->member = member;

    return Ret_Continue;
}
开发者ID:TheTypoMaster,项目名称:ElastosRDK5_0,代码行数:38,代码来源:parser.cpp

示例6: CreateCompatibleBitmap

/******************************************************************************
 * CreateCompatibleBitmap [[email protected]]
 *
 * Creates a bitmap compatible with the DC.
 *
 * PARAMS
 *    hdc    [I] Handle to device context
 *    width  [I] Width of bitmap
 *    height [I] Height of bitmap
 *
 * RETURNS
 *    Success: Handle to bitmap
 *    Failure: 0
 */
HBITMAP WINAPI CreateCompatibleBitmap( HDC hdc, INT width, INT height)
{
    char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors[256] )];
    BITMAPINFO *bi = (BITMAPINFO *)buffer;
    DIBSECTION dib;

    TRACE("(%p,%d,%d)\n", hdc, width, height);

    if (GetObjectType( hdc ) != OBJ_MEMDC)
        return CreateBitmap( width, height,
                             GetDeviceCaps(hdc, PLANES), GetDeviceCaps(hdc, BITSPIXEL), NULL );

    switch (GetObjectW( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(dib), &dib ))
    {
    case sizeof(BITMAP): /* A device-dependent bitmap is selected in the DC */
        return CreateBitmap( width, height, dib.dsBm.bmPlanes, dib.dsBm.bmBitsPixel, NULL );

    case sizeof(DIBSECTION): /* A DIB section is selected in the DC */
        bi->bmiHeader = dib.dsBmih;
        bi->bmiHeader.biWidth  = width;
        bi->bmiHeader.biHeight = height;
        if (dib.dsBmih.biCompression == BI_BITFIELDS)  /* copy the color masks */
            memcpy(bi->bmiColors, dib.dsBitfields, sizeof(dib.dsBitfields));
        else if (dib.dsBmih.biBitCount <= 8)  /* copy the color table */
            GetDIBColorTable(hdc, 0, 256, bi->bmiColors);
        return CreateDIBSection( hdc, bi, DIB_RGB_COLORS, NULL, NULL, 0 );

    default:
        return 0;
    }
}
开发者ID:MortenRoenne,项目名称:wine,代码行数:45,代码来源:bitmap.c

示例7: KillObject

void KillObject (ObjectRecHdl ObjectHdl)
// this subroutine releases the memory occupied by the given object handle
{
	OSType			thisObjectType;
	PolyObjectHdl	thisPolyHdl;
	LongPoint		**thisPointsHdl;
	
	if (ObjectHdl != nil)
	{
		GetObjectType (ObjectHdl, &thisObjectType);
		
		// dispose of any non-standard object data structures first
		switch (thisObjectType)
		{
			case kPolyType:
				thisPolyHdl = (PolyObjectHdl) ObjectHdl;
				thisPointsHdl = (LongPoint**) (**thisPolyHdl).objectDataHdl;
				if (thisPointsHdl != nil)
				{
					DisposeHandle ((Handle) thisPointsHdl);
					(**thisPolyHdl).objectDataHdl = nil;
				}
			break;
		}
		
		DisposeHandle ((Handle) ObjectHdl);		// finally, dispose the object handle
	}
	
	return;
}
开发者ID:JamesMakela-NOAA,项目名称:PyGnome,代码行数:30,代码来源:ObjectUtils.cpp

示例8: UI_CheckObjectMask

int32 UI_CheckObjectMask(int32 nMessage, AActor* oTarget)
{
	int32 nDispMask = GetM2DAInt(TABLE_UI_MESSAGES, "ObjectMask", nMessage);

	if (nDispMask != 0)
	{
		int32 bShow = ((nDispMask & 0xffffff) == 0xffffff);

		if (!bShow)
		{
			bShow = ((nDispMask & GetObjectType(oTarget)) == GetObjectType(oTarget));
		}

		return bShow;
	}
	return FALSE_;
}
开发者ID:dhk-room101,项目名称:da2ue4,代码行数:17,代码来源:ui_h.cpp

示例9: if

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *object - 
// Output : Returns true on success, false on failure.
//-----------------------------------------------------------------------------
bool CHintItemObjectBase::IsObjectOfType( C_BaseEntity *object )
{
	if ( !stricmp( GetObjectType(), "Resource Zone" ) )
	{
		return dynamic_cast< C_ResourceZone *>( object ) ? true : false;
	}
	else if ( !stricmp( GetObjectType(), "Resource Pump" ) )
	{
		return dynamic_cast< C_ObjectResourcePump * >( object) ? true : false;
	}
	else if ( !stricmp( GetObjectType(), "BaseObject" ) )
	{
		return dynamic_cast< C_BaseObject * >( object) ? true : false;
	}
	
	return false;
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:22,代码来源:hintitemobjectbase.cpp

示例10: SetContentSetsParent

ContentControl::ContentControl ()
{
	SetContentSetsParent (true);
	SetObjectType (Type::CONTENTCONTROL);

	ManagedTypeInfo type_info (GetObjectType (), "System.Windows.Controls.ContentControl");
	SetDefaultStyleKey (&type_info);
}
开发者ID:kangaroo,项目名称:moon,代码行数:8,代码来源:contentcontrol.cpp

示例11: return

int LuaObjectRenderingImpl::SetLODDistance(lua_State* L)
{
	// args=<objID, lodLevel, lodLength>
	//
	// length adjusted for 45 degree FOV with a 1024x768 screen; the magic
	// constant is 2.0f * math::tanf((45.0f * 0.5f) * (PI / 180.0f)) / 768.0f)
	return (SetLODLengthCommon(L, ParseSolidObject(L, __FUNCTION__, 1, GetObjectType()), 0.0010786811520132682f));
}
开发者ID:Liuyangbiao,项目名称:spring,代码行数:8,代码来源:LuaObjectRendering.cpp

示例12: GetIndex

BOOL CObjectEntry::StoreObjectDictionarySchema(XML_PARSER* pXmlParser)
{
    CStdString strIndex = "";
    CStdString strSubIndex = "";
    CStdString strParameterName = "";
    CStdString strObjectType = "";
    CStdString strDataType = "";
    CStdString strAccessType = "";
    CStdString strLowLimit = "";
    CStdString strHighLimit = "";
    CStdString strDefaultValue = "";
    CStdString strPDOMapping = "";
    CStdString strObjFlags = "";

    if(pXmlParser)
    {
        //ObjectEntry
        pXmlParser->AddNewLineTab();
        pXmlParser->Add_LastChildNode(_T("ObjectEntry"));
        pXmlParser->IncTabLevel();

        //Prepare Attributes
        GetIndex(strIndex);
        GetSubIndex(strSubIndex);
        GetParameterName(strParameterName);
        GetObjectType(strObjectType);
        GetDataType(strDataType, FALSE);
        GetAccessType(strAccessType);
        GetLowLimit(strLowLimit);
        GetHighLimit(strHighLimit);
        GetDefaultValue(strDefaultValue);
        GetPDOMapping(strPDOMapping);
        GetObjFlags(strObjFlags);

        //ObjectEntry Attributes
        pXmlParser->Set_Attribute(_T("Index"), strIndex);
        pXmlParser->Set_Attribute(_T("SubIndex"), strSubIndex);
        pXmlParser->Set_Attribute(_T("ParameterName"), strParameterName);
        pXmlParser->Set_Attribute(_T("ObjectType"), strObjectType);
        pXmlParser->Set_Attribute(_T("DataType"), strDataType);
        pXmlParser->Set_Attribute(_T("AccessType"), strAccessType);

        if(!strLowLimit.IsEmpty()) pXmlParser->Set_Attribute(_T("LowLimit"), strLowLimit);
        if(!strHighLimit.IsEmpty()) pXmlParser->Set_Attribute(_T("HighLimit"), strHighLimit);
        if(!strDefaultValue.IsEmpty()) pXmlParser->Set_Attribute(_T("DefaultValue"), strDefaultValue);
        if(!strPDOMapping.IsEmpty()) pXmlParser->Set_Attribute(_T("PDOMapping"), strPDOMapping);
        if(!strObjFlags.IsEmpty()) pXmlParser->Set_Attribute(_T("ObjFlags"), strObjFlags);

        //End ObjectEntry
        pXmlParser->DecTabLevel();
        pXmlParser->AddNewLineTab();
        pXmlParser->Go_to_Parent();

        return TRUE;
    }

    return FALSE;
}
开发者ID:RIVeR-Lab,项目名称:eposcmd,代码行数:58,代码来源:ObjectEntry.cpp

示例13: PatBltBrush

// CImgCtx (Public) -----------------------------------------------------------
void CImgCtx::Tile(
                   HDC hdc,
                   POINT* pptOrg,
                   RECT* prc,
                   SIZE* psizePrint,
                   COLORREF crBack,
                   IMGANIMSTATE* pImgAnimState,
                   DWORD dwFlags)
{
    BOOL fOpaque = !!(GetState() & IMGTRANS_OPAQUE);

    // If the source image is 1x1 just let the normal StretchBlt mechanism
    // fill up the destination.
    if(GetImgInfo()->_xWid==1 && GetImgInfo()->_yHei==1)
    {
        if(crBack != CLR_INVALID)
        {
            PatBltBrush(hdc, prc, PATCOPY, crBack);
        }

        if(pImgAnimState)
        {
            GetImgInfo()->DrawFrame(hdc, pImgAnimState, prc, NULL, NULL, dwFlags);
        }
        else
        {
            GetImgInfo()->DrawImage(hdc, prc, NULL, SRCCOPY, dwFlags);
        }

        goto Cleanup;
    }

    // If the image is opaque and we are writing into an offscreen bitmap
    // which is not clipped, just tile directly into it.
    if(psizePrint==NULL && (fOpaque || crBack!=CLR_INVALID) && GetObjectType(hdc)==OBJ_MEMDC)
    {
        RECT rcBox;
        int iRgn = GetClipBox(hdc, &rcBox);

        if(iRgn==NULLREGION
            || (iRgn==SIMPLEREGION
            && prc->left>=rcBox.left
            && prc->top>=rcBox.top
            && prc->right<=rcBox.right
            && prc->bottom<=rcBox.bottom))
        {
            TileFast(hdc, prc, pptOrg->x, pptOrg->y, fOpaque, crBack, pImgAnimState, dwFlags);
            goto Cleanup;
        }
    }

    // Otherwise just tile the slow way (it may still decide to pretile)
    TileSlow(hdc, prc, pptOrg->x, pptOrg->y, psizePrint, fOpaque, crBack, pImgAnimState, dwFlags);

Cleanup:
    ;
}
开发者ID:hufuman,项目名称:xindows,代码行数:58,代码来源:ImgCtx.cpp

示例14: GroundFilterFn

bool GroundFilterFn(HOBJECT hObj, void *pUserData)
{
    if ( IsMainWorld(hObj) || (OT_WORLDMODEL == GetObjectType(hObj)) )
    {
        return true;
    }

    return false;
}
开发者ID:jordandavidson,项目名称:lithtech,代码行数:9,代码来源:AIUtils.cpp

示例15: IsMetaFile

BOOL IsMetaFile(
    HDC hdc)
{
    DWORD dwType = GetObjectType(hdc);
    return (dwType == OBJ_METAFILE ||
            dwType == OBJ_METADC ||
            dwType == OBJ_ENHMETAFILE ||
            dwType == OBJ_ENHMETADC);
}
开发者ID:conioh,项目名称:os-design,代码行数:9,代码来源:drawtext.c


注:本文中的GetObjectType函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。