• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetObjectType函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SetContentSetsParent

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

	ManagedTypeInfo *type_info = g_new (ManagedTypeInfo, 1);
	type_info->Initialize (GetObjectType (), "System.Windows.Controls.ContentControl");
	SetDefaultStyleKey (type_info);
	ManagedTypeInfo::Free (type_info);
}
开发者ID:lewing,项目名称:moon,代码行数:10,代码来源:contentcontrol.cpp


示例17: nulldrv_StretchBlt

/* nulldrv fallback implementation using StretchDIBits */
BOOL CDECL nulldrv_StretchBlt( PHYSDEV dst_dev, INT xDst, INT yDst, INT widthDst, INT heightDst,
                               PHYSDEV src_dev, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc,
                               DWORD rop )
{
    DC *dc = get_nulldrv_dc( dst_dev );
    BITMAP bm;
    BITMAPINFOHEADER info_hdr;
    HBITMAP hbm;
    LPVOID bits;
    INT lines;
    POINT pts[2];

    /* make sure we have a real implementation for StretchDIBits */
    if (GET_DC_PHYSDEV( dc, pStretchDIBits ) == dst_dev) return 0;

    pts[0].x = xSrc;
    pts[0].y = ySrc;
    pts[1].x = xSrc + widthSrc;
    pts[1].y = ySrc + heightSrc;
    LPtoDP( src_dev->hdc, pts, 2 );
    xSrc      = pts[0].x;
    ySrc      = pts[0].y;
    widthSrc  = pts[1].x - pts[0].x;
    heightSrc = pts[1].y - pts[0].y;

    if (GetObjectType( src_dev->hdc ) != OBJ_MEMDC) return FALSE;
    if (!GetObjectW( GetCurrentObject( src_dev->hdc, OBJ_BITMAP ), sizeof(bm), &bm )) return FALSE;

    info_hdr.biSize = sizeof(info_hdr);
    info_hdr.biWidth = bm.bmWidth;
    info_hdr.biHeight = bm.bmHeight;
    info_hdr.biPlanes = 1;
    info_hdr.biBitCount = 32;
    info_hdr.biCompression = BI_RGB;
    info_hdr.biSizeImage = 0;
    info_hdr.biXPelsPerMeter = 0;
    info_hdr.biYPelsPerMeter = 0;
    info_hdr.biClrUsed = 0;
    info_hdr.biClrImportant = 0;

    if (!(bits = HeapAlloc(GetProcessHeap(), 0, bm.bmHeight * bm.bmWidth * 4)))
        return FALSE;

    /* Select out the src bitmap before calling GetDIBits */
    hbm = SelectObject( src_dev->hdc, GetStockObject(DEFAULT_BITMAP) );
    lines = GetDIBits( src_dev->hdc, hbm, 0, bm.bmHeight, bits, (BITMAPINFO*)&info_hdr, DIB_RGB_COLORS );
    SelectObject( src_dev->hdc, hbm );

    if (lines) lines = StretchDIBits( dst_dev->hdc, xDst, yDst, widthDst, heightDst,
                                          xSrc, bm.bmHeight - heightSrc - ySrc, widthSrc, heightSrc,
                                          bits, (BITMAPINFO*)&info_hdr, DIB_RGB_COLORS, rop );
    HeapFree( GetProcessHeap(), 0, bits );
    return (lines == heightSrc);
}
开发者ID:lfzawacki,项目名称:wine,代码行数:55,代码来源:bitblt.c


示例18: GetObjectType

	ChildListId RetainedEntities::GetChildListId(ObjectTypeId typeId, const utf8 name[]) const
    {
        auto type = GetObjectType(typeId);
        if (!type) return 0;

        for (auto i=type->_childLists.cbegin(); i!=type->_childLists.cend(); ++i)
            if (!XlCompareStringI(i->c_str(), name)) 
                return (PropertyId)std::distance(type->_childLists.cbegin(), i);
        
        type->_childLists.push_back(name);
        return (PropertyId)(type->_childLists.size()-1);
    }
开发者ID:coreafive,项目名称:XLE,代码行数:12,代码来源:RetainedEntities.cpp


示例19: ParseStringToken

void ParseStringToken()
{
    int n = 0;
    char *s, buf[c_nStrBufSize];
    LubeToken token;
    ObjectType object;
    MemberType member;

    s = g_szCurrentToken;
    while (*s) {
        if (c_nEmbedPrefix != *s) {
            buf[n++] = *s++;
        }
        else {
            s++; // skip prefix char
            token = *(LubeToken *)s;
            s += sizeof(LubeToken); // skip token

            if (IsObjectToken(token)) {
                if (*s != '.' || *(s + 1) != c_nEmbedPrefix) {
                    ErrorReport(Lube_E_InvalidEmbed);
                    return;
                }
                s += 2;

                object = GetObjectType(token);
                if (Object_None == object) return;

                token = *(LubeToken *)s;
                s += sizeof(LubeToken); // skip token
            }
            else {
                object = s_pContext->m_curObject;
            }

            if (!IsMemberToken(token)) {
                ErrorReport(Lube_E_InvalidEmbed);
                return;
            }
            member = GetMemberType(object, token);
            if (Member_None == member) return;

            buf[n++] = c_nEmbedPrefix;
            buf[n++] = (char)object;
            buf[n++] = (char)member;
        }
    }
    buf[n] = 0;
    strcpy(g_szCurrentToken, buf);
}
开发者ID:TheTypoMaster,项目名称:ElastosRDK5_0,代码行数:50,代码来源:parser.cpp


示例20: TRACE

/**********************************************************************
 *          MFDRV_CloseMetaFile
 */
static DC *MFDRV_CloseMetaFile( HDC hdc )
{
    DC *dc;
    METAFILEDRV_PDEVICE *physDev;

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

    if (!(dc = get_dc_ptr( hdc ))) return NULL;
    if (GetObjectType( hdc ) != OBJ_METADC)
    {
        release_dc_ptr( dc );
        return NULL;
    }
    if (dc->refcount != 1)
    {
        FIXME( "not deleting busy DC %p refcount %u\n", hdc, dc->refcount );
        release_dc_ptr( dc );
        return NULL;
    }
    physDev = (METAFILEDRV_PDEVICE *)dc->physDev;

    /* Construct the end of metafile record - this is documented
     * in SDK Knowledgebase Q99334.
     */

    if (!MFDRV_MetaParam0(dc->physDev, META_EOF))
    {
        free_dc_ptr( dc );
	return 0;
    }

    if (physDev->mh->mtType == METAFILE_DISK)  /* disk based metafile */
    {
        if (SetFilePointer(physDev->hFile, 0, NULL, FILE_BEGIN) != 0) {
            free_dc_ptr( dc );
            return 0;
        }

	physDev->mh->mtType = METAFILE_MEMORY; /* This is what windows does */
        if (!WriteFile(physDev->hFile, physDev->mh, sizeof(*physDev->mh),
                       NULL, NULL)) {
            free_dc_ptr( dc );
            return 0;
        }
        CloseHandle(physDev->hFile);
	physDev->mh->mtType = METAFILE_DISK;
    }

    return dc;
}
开发者ID:Barrell,项目名称:wine,代码行数:53,代码来源:init.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetObjectW函数代码示例发布时间:2022-05-30
下一篇:
C++ GetObjectPtr函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap