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

C++ Attach函数代码示例

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

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



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

示例1: _ASSERT_VALID

// Constructor. Initializes to a handle.
ClsDC::ClsDC( HDC hDC )
{
	_ASSERT_VALID( hDC ); // Must be valid.

	// Clear handle.
	m_hDC = NULL;

	// Attach the handle.
	Attach( hDC );

	// Add us to the global list.
	global_dc_list.AddHead( this );
}
开发者ID:jcbaar,项目名称:ClassLib,代码行数:14,代码来源:dc.cpp


示例2: GetWindowsDirectory

CSysImageList::CSysImageList()
{
	SHFILEINFO ssfi;
	TCHAR windir[MAX_PATH];
	GetWindowsDirectory(windir, _countof(windir));  // MAX_PATH ok.
	HIMAGELIST hSystemImageList =
		(HIMAGELIST)SHGetFileInfo(
			windir,
			0,
			&ssfi, sizeof ssfi,
			SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
	Attach(hSystemImageList);
}
开发者ID:chengn,项目名称:TortoiseGit,代码行数:13,代码来源:SysImageList.cpp


示例3: Attach

void Transmogrify::Spawn(float duration, int targetUUID)
{
	mDuration = duration;

	for (Explorer& e : Factory<Explorer>())
	{
		// Only affects clients who are not the target
		if (e.mNetworkID->mUUID == targetUUID && !e.mNetworkID->mHasAuthority)
		{
			Attach(&e);
		}
	}
}
开发者ID:igm-capstone,项目名称:capstone-game-cpp,代码行数:13,代码来源:Transmogrify.cpp


示例4: getprotobyname

SOCKET Socket::CreateSocket(int af,int type, const std::string& protocol)
{
	struct protoent *p = NULL;
	SOCKET s;

#ifdef ENABLE_POOL
	m_socket_type = type;
	m_socket_protocol = protocol;
#endif
	if (protocol.size())
	{
		p = getprotobyname( protocol.c_str() );
		if (!p)
		{
			Handler().LogError(this, "getprotobyname", Errno, StrError(Errno), LOG_LEVEL_FATAL);
			SetCloseAndDelete();
#ifdef ENABLE_EXCEPTIONS
			throw Exception(std::string("getprotobyname() failed: ") + StrError(Errno));
#endif
			return INVALID_SOCKET;
		}
	}
	int protno = p ? p -> p_proto : 0;

	s = socket(af, type, protno);
	if (s == INVALID_SOCKET)
	{
		Handler().LogError(this, "socket", Errno, StrError(Errno), LOG_LEVEL_FATAL);
		SetCloseAndDelete();
#ifdef ENABLE_EXCEPTIONS
		throw Exception(std::string("socket() failed: ") + StrError(Errno));
#endif
		return INVALID_SOCKET;
	}
	Attach(s);
	OnOptions(af, type, protno, s);
	Attach(INVALID_SOCKET);
	return s;
}
开发者ID:Omniasoft,项目名称:BellPi,代码行数:39,代码来源:Socket.cpp


示例5: Attach

HRESULT Kernel::GetWaitChainInfo(WaitSnapshot& snapshot)
{
	_pCurrentSnapshot = &snapshot;
	HRESULT hr = Attach();
	if(SUCCEEDED(hr))
	{
		snapshot.Initialize(_KProcess, _OSProcessId);
		hr = ProcessHandles();
		hr = ProcessThreadWaitList();
	}
	_pCurrentSnapshot = NULL;
	return hr;
}
开发者ID:Sequential,项目名称:DebugInspector,代码行数:13,代码来源:Kernel.cpp


示例6: LKASSERT

void LKWindowSurface::Create(Window& Wnd){
#ifdef WIN32
    HWND hWnd = Wnd.Handle();
    LKASSERT(hWnd);
    LKASSERT(::IsWindow(hWnd));

    if(!Attach(::GetDC(hWnd))) {
        LKASSERT(false);
    }
#else
    _pCanvas = new WindowCanvas(Wnd);
#endif
}
开发者ID:SergioDaSilva82,项目名称:LK8000,代码行数:13,代码来源:LKWindowSurface.cpp


示例7: switch

// open the file
bool wxFile::Open(const wxChar *szFileName, OpenMode mode, int accessMode)
{
    int flags = O_BINARY;

    switch ( mode )
    {
        case read:
            flags |= O_RDONLY;
            break;

        case write_append:
            if ( wxFile::Exists(szFileName) )
            {
                flags |= O_WRONLY | O_APPEND;
                break;
            }
            //else: fall through as write_append is the same as write if the
            //      file doesn't exist

        case write:
            flags |= O_WRONLY | O_CREAT | O_TRUNC;
            break;

        case write_excl:
            flags |= O_WRONLY | O_CREAT | O_EXCL;
            break;

        case read_write:
            flags |= O_RDWR;
            break;
    }

#ifdef __WINDOWS__
    // only read/write bits for "all" are supported by this function under
    // Windows, and VC++ 8 returns EINVAL if any other bits are used in
    // accessMode, so clear them as they have at best no effect anyhow
    accessMode &= wxS_IRUSR | wxS_IWUSR;
#endif // __WINDOWS__

    int fd = wxOpen( szFileName, flags ACCESS(accessMode));

    if ( fd == -1 )
    {
        wxLogSysError(_("can't open file '%s'"), szFileName);
        return false;
    }
    else {
        Attach(fd);
        return true;
    }
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:52,代码来源:file.cpp


示例8: Close

    Handle& Handle::operator=(Handle& h)
    {
        if (mHandle_ != h)
        {
            if (NULL != mHandle_)
            {
                Close();
            }

            Attach(h.Detach());
        }

        return *this;
    }
开发者ID:crezul,项目名称:my-self-education-sync-lib,代码行数:14,代码来源:Handle.cpp


示例9: Attach

///////////////////////////////////////////////////////////////////////////////
// AttachFromVariant: Attach a Variant SafeArray
bool CSafeArrayHelper::AttachFromVariant(VARIANT* pVariant)
{
	if (NULL != pVariant)
	{
		if (pVariant->vt & VT_ARRAY)
		{
			LPSAFEARRAY psa = pVariant->parray;
			if (pVariant->vt & VT_BYREF)	// VB use this...
				psa = *pVariant->pparray;
			return Attach( psa );
		}
	}
	return false;
}
开发者ID:Spritutu,项目名称:AiPI-1,代码行数:16,代码来源:SafeArrayHelper.cpp


示例10: parentMatrix

DemoEntity::DemoEntity(DemoEntityManager& world, const dScene* scene, dScene::dTreeNode* rootSceneNode, dTree<DemoMesh*, dScene::dTreeNode*>& 	 	meshCache, DemoEntityManager::EntityDictionary& entityDictionary, DemoEntity* parent)
	:dClassInfo()
	,dHierarchy<DemoEntity>() 
	,m_matrix(GetIdentityMatrix()) 
	,m_curPosition (0.0f, 0.0f, 0.0f, 1.0f)
	,m_nextPosition (0.0f, 0.0f, 0.0f, 1.0f)
	,m_curRotation (1.0f, 0.0f, 0.0f, 0.0f)
	,m_nextRotation (1.0f, 0.0f, 0.0f, 0.0f)
	,m_lock (0)
	,m_mesh (NULL)
{
	// add this entity to the dictionary
	entityDictionary.Insert(this, rootSceneNode);

	// if this is a child mesh set it as child of th entity
	dMatrix parentMatrix (GetIdentityMatrix());
	if (parent) {
		Attach (parent);

		dScene::dTreeNode* parentNode = scene->FindParentByType(rootSceneNode, dSceneNodeInfo::GetRttiType());
		dSceneNodeInfo* parentInfo = (dSceneNodeInfo*) parentNode;
		parentMatrix = parentInfo->GetTransform();
	}

	dSceneNodeInfo* info = (dSceneNodeInfo*) scene->GetInfoFromNode (rootSceneNode);
//	SetMatrix(info->GetTransform() * parentMatrix.Inverse4x4());
	dMatrix matrix (info->GetTransform() * parentMatrix.Inverse4x4());
	dQuaternion rot (matrix);

	// set the matrix twice in oder to get cur and next position
	SetMatrix(world, rot, matrix.m_posit);
	SetMatrix(world, rot, matrix.m_posit);


	// if this node has a mesh, find it and attach it to this entity
	dScene::dTreeNode* meshNode = scene->FindChildByType(rootSceneNode, dMeshNodeInfo::GetRttiType());
	if (meshNode) {
		DemoMesh* mesh = meshCache.Find(meshNode)->GetInfo();
		SetMesh(mesh);
	}

	// add all of the children nodes as child nodes
	for (void* child = scene->GetFirstChild(rootSceneNode); child; child = scene->GetNextChild (rootSceneNode, child)) {
		dScene::dTreeNode* node = scene->GetNodeFromLink(child);
		dNodeInfo* info = scene->GetInfoFromNode(node);
		if (info->GetTypeId() == dSceneNodeInfo::GetRttiType()) {
			new DemoEntity (world, scene, node, meshCache, entityDictionary, this);
		}
	}
}
开发者ID:Naddiseo,项目名称:Newton-Dynamics-fork,代码行数:50,代码来源:DemoEntity.cpp


示例11: Create

    __checkReturn HRESULT Create(__in DWORD threadCount)
    {
        Attach(::CreateIoCompletionPort(INVALID_HANDLE_VALUE,
                                        0, // no existing port
                                        0, // ignored
                                        threadCount));

        if (0 == m_h)
        {
            return HRESULT_FROM_WIN32(::GetLastError());
        }

        return S_OK;
    }
开发者ID:daewoolanos,项目名称:gwca,代码行数:14,代码来源:Communicator.cpp


示例12: xSemaphoreCreateMutex

bool CMutex::Create() {

#if ( configUSE_MUTEXES == 1 )

	SemaphoreHandle_t handle;

	handle = xSemaphoreCreateMutex();

	if (handle != NULL)
		Attach(handle);
#endif

	return IsValid();
}
开发者ID:dessel,项目名称:stf12,代码行数:14,代码来源:CMutex.cpp


示例13: AttachBlackOfScreen

    ///////////////////////////////////////////////////////////////////////
    ///  Function: AttachBlackOfScreen
    ///
    ///    Author: $author$
    ///      Date: 2/8/2013
    ///////////////////////////////////////////////////////////////////////
    virtual XosError AttachBlackOfScreen(Screen* xScreen, bool onlyFreed=false) 
    {
        XosError error = XOS_ERROR_FAILED;
        XosError error2;

        if ((error2 = Freed(onlyFreed)))
            return error2;

        if ((xScreen)) {
            Attach(XBlackPixelOfScreen(xScreen));
            error = XOS_ERROR_NONE;
        }
        return error;
    }
开发者ID:medusade,项目名称:mxde,代码行数:20,代码来源:XosXColor.hpp


示例14: Printf

int ProfilerHandler::Load() {
  amx_path_ = fileutils::ToUnixPath(amx_path_finder_->Find(amx()));
  amx_name_ = fileutils::GetDirectory(amx_path_)
            + "/"
            + fileutils::GetBaseName(amx_path_);

  if (amx_path_.empty()) {
    Printf("Could not find AMX file (try setting AMX_PATH?)");
  }
  if (ShouldBeProfiled(amx_path_)) {
    Attach();
  }
  return AMX_ERR_NONE;
}
开发者ID:Zeex,项目名称:samp-plugin-profiler,代码行数:14,代码来源:profilerhandler.cpp


示例15: Initialize

    HRESULT Initialize(PCWSTR serverName,
                       INTERNET_PORT portNumber,
                       const WinHttpSession& session)
    {
        if (!Attach(::WinHttpConnect(session.m_handle,
                                     serverName,
                                     portNumber,
                                     0))) // reserved
        {
            return HRESULT_FROM_WIN32(::GetLastError());
        }

        return S_OK;
    }
开发者ID:vit2000005,项目名称:happy_trader,代码行数:14,代码来源:wininetwrap.hpp


示例16: REFCOUNT_ADD

SelectionKeyImpl::SelectionKeyImpl(
    /* [in] */ IAbstractSelectableChannel* channel,
    /* [in] */ Int32 ops,
    /* [in] */ IObject* attachment,
    /* [in] */ IAbstractSelector* selector)
{
    REFCOUNT_ADD(channel);
    this->mChannel = channel;
    this->mInterestOps = ops;
    REFCOUNT_ADD(selector);
    this->mSelector = selector;
    AutoPtr<IObject> tempObj;
    Attach(attachment, (IObject**)&tempObj);
}
开发者ID:TheTypoMaster,项目名称:ElastosRDK5_0,代码行数:14,代码来源:SelectionKeyImpl.cpp


示例17: Attach

void UdpSocket::SendToBuf(SocketAddress& ad, const char *data, int len, int flags)
{
	if (GetSocket() == INVALID_SOCKET)
	{
		Attach(CreateSocket(ad.GetFamily(), SOCK_DGRAM, "udp"));
	}
	if (GetSocket() != INVALID_SOCKET)
	{
		SetNonblocking(true);
		if ((m_last_size_written = sendto(GetSocket(), data, len, flags, ad, ad)) == -1)
		{
			Handler().LogError(this, "sendto", Errno, StrError(Errno), LOG_LEVEL_ERROR);
		}
	}
}
开发者ID:f059074251,项目名称:interested,代码行数:15,代码来源:UdpSocket.cpp


示例18: CreateWindowEx

		BOOL CULDateTimePicker::Create(HWND hParentWnd,WORD wID,int x,int y,int cx,int cy,DWORD dwStyle)
		{
			m_hWnd = CreateWindowEx(0,
				DATETIMEPICK_CLASS,
				NULL,
				dwStyle,
				x,y,cx,cy,
				hParentWnd,
				(HMENU)wID,
				ULOther::ULGetResourceHandle(),
				this);
			if(!m_hWnd)
				return FALSE;
			return Attach(m_hWnd);
		}
开发者ID:piroxiljin,项目名称:ullib,代码行数:15,代码来源:ULDateTimePicker.cpp


示例19: IsValid

BOOL CVisualBoyHandler::RefreshAddressList(VOID)
{
	BOOL	bResult = IsValid();

	if(!bResult)
	{
		bResult = Attach();
	}
	else
	{
		bResult = SearchForPtrStruct();
	}

	return bResult;
}
开发者ID:h16o2u9u,项目名称:rtoss,代码行数:15,代码来源:VisualBoyHandler.cpp


示例20: CBlockEvalStateSemantics

CBlockEvaluator::CBlockEvaluator(FlwNode * pNd,
                                 DWORD Options,
                                 CReactionBase * pRB,
                                 CHXBase *pHX,
                                 CEnvironHXBase * pEHX,
                                 CVLEBase * pVLE,
                                 CEvapBase * pEvap) :
  CBlockEvalStateSemantics(false)
  {
  m_pNd             = pNd;
  m_Options         = Options;
  //m_bAllowStateSemantics = false;
  
  Attach((Options & BEO_StateSemantics)!=0, pRB, pHX, pEHX, pVLE, pEvap);
  };
开发者ID:ChrisMoreton,项目名称:Test3,代码行数:15,代码来源:BlockEvaluator.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ AttachChild函数代码示例发布时间:2022-05-30
下一篇:
C++ AtomicString函数代码示例发布时间: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