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


C++ OBJLIST::insert方法代码示例

本文整理汇总了C++中OBJLIST::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ OBJLIST::insert方法的具体用法?C++ OBJLIST::insert怎么用?C++ OBJLIST::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OBJLIST的用法示例。


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

示例1: Nudge_AddAccount

void Nudge_AddAccount(PROTOACCOUNT *proto)
{
	char str[MAXMODULELABELLENGTH + 10];
	mir_snprintf(str, "%s/Nudge", proto->szModuleName);
	HANDLE hevent = HookEvent(str, NudgeReceived);
	if (hevent == NULL)
		return;

	nProtocol++;

	// Add a specific sound per protocol
	CNudgeElement *p = new CNudgeElement();
	mir_snprintf(p->NudgeSoundname, "%s: Nudge", proto->szModuleName);

	strcpy_s(p->ProtocolName, proto->szModuleName);
	_tcscpy_s(p->AccountName, proto->tszAccountName);

	p->Load();
	p->hEvent = hevent;

	TCHAR soundDesc[MAXMODULELABELLENGTH + 10];
	mir_sntprintf(soundDesc, LPGENT("Nudge for %s"), proto->tszAccountName);
	SkinAddNewSoundExT(p->NudgeSoundname, LPGENT("Nudge"), soundDesc);

	arNudges.insert(p);
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:26,代码来源:main.cpp

示例2: fclose

MIR_CORE_DLL(HANDLE) mir_createLog(const char* pszName, const TCHAR *ptszDescr, const TCHAR *ptszFile, unsigned options)
{
	if (ptszFile == NULL)
		return NULL;

	Logger *result = new Logger(pszName, ptszDescr, ptszFile, options);
	if (result == NULL)
		return NULL;

	int idx = arLoggers.getIndex(result);
	if (idx != -1) {
		delete result;
		return &arLoggers[idx];
	}

	FILE *fp = _tfopen(ptszFile, _T("ab"));
	if (fp == NULL) {
		TCHAR tszPath[MAX_PATH];
		_tcsncpy_s(tszPath, ptszFile, _TRUNCATE);
		CreatePathToFileT(tszPath);
	}
	else fclose(fp);

	DeleteFile(ptszFile);
	arLoggers.insert(result);
	return result;
}
开发者ID:wyrover,项目名称:miranda-ng,代码行数:27,代码来源:logger.cpp

示例3: CallMainThread

void CallMainThread(MirApcFunc func, void* param)
{
	WaitForSingleObject(hApcMutex, INFINITE);
	APCCallQueue.insert(new APCCall(func, param));
	ReleaseMutex(hApcMutex);
	PostMessage(hAPCWindow, WM_NULL, 0, 0);
}
开发者ID:raoergsls,项目名称:miranda,代码行数:7,代码来源:miranda.cpp

示例4: getCacheItem

// преобразует mode в HICON который НЕ НУЖНО разрушать в конце
static ICON_CACHE& getCacheItem(int mode, int type)
{
	int m = mode & 0x0f, s = (mode & SECURED)>>4, i; // разобрали на части - режим и состояние
	HICON icon;

	for (i=0; i < arIcoList.getCount(); i++)
		if (arIcoList[i].mode == ((type<<8) | mode))
			return arIcoList[i];

	i = s;
	switch(type) {
		case 1: i += IEC_CL_DIS; break;
		case 2: i += ICO_CM_DIS; break;
		case 3: i += ICO_MW_DIS; break;
	}

	if (type == 1)
		icon = BindOverlayIcon(g_hIEC[i], g_hICO[ICO_OV_NAT+m]);
	else
		icon = BindOverlayIcon(g_hICO[i], g_hICO[ICO_OV_NAT+m]);

	ICON_CACHE *p = new ICON_CACHE;
	p->icon = icon;
	p->mode = (type << 8) | mode;
	p->hCLIcon = NULL;
	arIcoList.insert(p);

	return *p;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:30,代码来源:crypt_icons.cpp

示例5: getContactCache

CContactCache* CContactCache::getContactCache(HANDLE hContact)
{
	CContactCache *cc = arContacts.find((CContactCache*)&hContact);
	if (cc == NULL) {
		cc = new CContactCache(hContact);
		arContacts.insert(cc);
	}
	return cc;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:9,代码来源:contactcache.cpp

示例6: InitTimeZones

void InitTimeZones(void)
{
	REG_TZI_FORMAT	tzi;
	HKEY			hKey;

	const TCHAR *tszKey = _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones");

	/*
	 * use GetDynamicTimeZoneInformation() on Vista+ - this will return a structure with
	 * the registry key name, so finding our own time zone later will be MUCH easier for
	 * localized systems or systems with a MUI pack installed
	 */
	if (IsWinVerVistaPlus())
		pfnGetDynamicTimeZoneInformation = (pfnGetDynamicTimeZoneInformation_t)GetProcAddress(GetModuleHandle(_T("kernel32")), "GetDynamicTimeZoneInformation");

	if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_LOCAL_MACHINE, tszKey, 0, KEY_ENUMERATE_SUB_KEYS, &hKey)) {
		DWORD	dwIndex = 0;
		HKEY	hSubKey;
		TCHAR	tszName[MIM_TZ_NAMELEN];

		DWORD dwSize = _countof(tszName);
		while (ERROR_NO_MORE_ITEMS != RegEnumKeyEx(hKey, dwIndex++, tszName, &dwSize, NULL, NULL, 0, NULL)) {
			if (ERROR_SUCCESS == RegOpenKeyEx(hKey, tszName, 0, KEY_QUERY_VALUE, &hSubKey)) {
				dwSize = sizeof(tszName);

				DWORD dwLength = sizeof(tzi);
				if (ERROR_SUCCESS != RegQueryValueEx(hSubKey, _T("TZI"), NULL, NULL, (unsigned char *)&tzi, &dwLength))
					continue;

				MIM_TIMEZONE *tz = new MIM_TIMEZONE;

				tz->tzi.Bias = tzi.Bias;
				tz->tzi.StandardDate = tzi.StandardDate;
				tz->tzi.StandardBias = tzi.StandardBias;
				tz->tzi.DaylightDate = tzi.DaylightDate;
				tz->tzi.DaylightBias = tzi.DaylightBias;

				mir_tstrcpy(tz->tszName, tszName);
				tz->hash = mir_hashstrT(tszName);
				tz->offset = INT_MIN;

				GetLocalizedString(hSubKey, _T("Display"), tz->szDisplay, _countof(tz->szDisplay));
				GetLocalizedString(hSubKey, _T("Std"), tz->tzi.StandardName, _countof(tz->tzi.StandardName));
				GetLocalizedString(hSubKey, _T("Dlt"), tz->tzi.DaylightName, _countof(tz->tzi.DaylightName));

				g_timezones.insert(tz);
				g_timezonesBias.insert(tz);

				RegCloseKey(hSubKey);
			}
			dwSize = _countof(tszName);
		}
		RegCloseKey(hKey);
	}

	RecalculateTime();
}
开发者ID:ybznek,项目名称:miranda-ng,代码行数:57,代码来源:timezones.cpp

示例7: xpt_AddThemeHandle

XPTHANDLE xpt_AddThemeHandle(HWND hwnd, LPCWSTR className)
{
	mir_cslock lck(xptCS);
	XPTObject* xptObject = new XPTObject;
	xptObject->lpcwClassObject = className;
	xptObject->hOwnerWindow = hwnd;
	_sttXptReloadThemeData(xptObject);
	xptObjectList.insert(xptObject);
	return (XPTHANDLE)xptObject;
}
开发者ID:tweimer,项目名称:miranda-ng,代码行数:10,代码来源:modern_xptheme.cpp

示例8: AddProtoIconIndex

static void AddProtoIconIndex(PROTOACCOUNT *pa)
{
	ProtoIconIndex *pii = new ProtoIconIndex;
	pii->szProto = pa->szModuleName;
	for (int i = 0; i < _countof(statusModeList); i++) {
		int iImg = ImageList_AddIcon_ProtoIconLibLoaded(hCListImages, pa->szModuleName, statusModeList[i]);
		if (i == 0)
			pii->iIconBase = iImg;
	}
	protoIconIndex.insert(pii);
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:11,代码来源:clistmod.cpp

示例9: SetChatTimer

void CIrcProto::SetChatTimer(UINT_PTR &nIDEvent,UINT uElapse, TIMERPROC lpTimerFunc)
{
    if (nIDEvent)
        KillChatTimer(nIDEvent);

    nIDEvent = SetTimer( NULL, NULL, uElapse, lpTimerFunc);

    EnterCriticalSection( &timers_cs );
    timers.insert( new TimerPair( this, nIDEvent ));
    LeaveCriticalSection( &timers_cs );
}
开发者ID:raoergsls,项目名称:miranda,代码行数:11,代码来源:tools.cpp

示例10: xpt_AddThemeHandle

XPTHANDLE xpt_AddThemeHandle(HWND hwnd, LPCWSTR className)
{
    XPTHANDLE res = NULL;
    xptlock();
    {
        XPTObject* xptObject = new XPTObject;
        xptObject->lpcwClassObject = className;
        xptObject->hOwnerWindow = hwnd;
        _sttXptReloadThemeData(xptObject);
        xptObjectList.insert(xptObject);
        res = (XPTHANDLE)xptObject;
    }
    xptunlock();
    return res;
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:15,代码来源:modern_xptheme.cpp

示例11: QueueAdd

static void QueueAdd(MCONTACT hContact, int waitTime)
{
	if (fei == NULL || g_shutDown)
		return;

	mir_cslock lck(cs);

	// Only add if not exists yet
	for (int i = queue.getCount() - 1; i >= 0; i--)
		if (queue[i].hContact == hContact)
			return;

	QueueItem *item = new QueueItem;
	item->hContact = hContact;
	item->check_time = GetTickCount() + waitTime;
	queue.insert(item);
}
开发者ID:fatty-,项目名称:miranda-ng,代码行数:17,代码来源:poll.cpp

示例12: FindProto

static ProtoInfo* FindProto(const char *proto)
{
	ProtoInfo *p = arProtos.find((ProtoInfo*)&proto);
	if (p)
		return p;

	HICON hIcon = LoadSkinnedProtoIcon(proto, ID_STATUS_ONLINE);
	if (hIcon == NULL)
		return NULL;

	HANDLE hImage = ExtraIcon_Add(hIcon);
	if (hImage == INVALID_HANDLE_VALUE)
		return NULL;

	p = new ProtoInfo(proto, hImage);
	arProtos.insert(p);
	return p;
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:18,代码来源:DefaultExtraIcons.cpp

示例13: GetSmileyFile

bool GetSmileyFile(CMString& url, const CMString& packstr)
{
	_TPattern *urlsplit = _TPattern::compile(_T(".*/(.*)"));
	_TMatcher *m0 = urlsplit->createTMatcher(url);

	m0->findFirstMatch();

	CMString filename;
	filename.AppendFormat(_T("%s\\%s\\"), cachepath, packstr.c_str());
	int pathpos = filename.GetLength();
	filename += m0->getGroup(1);

	delete m0;
	delete urlsplit;

	bool needext = filename.Find('.') == -1;
	if (needext)
		filename += _T(".*");

	_tfinddata_t c_file;
	INT_PTR hFile = _tfindfirst((TCHAR*)filename.c_str(), &c_file);
	if (hFile > -1) {
		_findclose(hFile);
		filename.Truncate(pathpos);
		filename += c_file.name;
		url = filename;
		return false;
	}
	if (needext)
		filename.Truncate(filename.GetLength() - 1);

	WaitForSingleObject(g_hDlMutex, 3000);
	dlQueue.insert(new QueueElem(url, filename, needext));
	ReleaseMutex(g_hDlMutex);

	if (!threadRunning) {
		threadRunning = true;
		mir_forkthread(SmileyDownloadThread, NULL);
	}

	url = filename;
	return false;
}
开发者ID:Seldom,项目名称:miranda-ng,代码行数:43,代码来源:download.cpp

示例14: AddCacheImage

ImageBase* AddCacheImage(const CMString& file, int index)
{
	CMString tmpfile(file); tmpfile.AppendFormat(_T("#%d"), index);
	unsigned id = mir_hash(tmpfile.c_str(), tmpfile.GetLength() * sizeof(TCHAR));

	WaitForSingleObject(g_hMutexIm, 3000);

	ImageBase srch(id);
	ImageBase *img = g_imagecache.find(&srch);
	if (img == NULL) {
		int ind = file.ReverseFind('.');
		if (ind == -1)
			return NULL;

		CMString ext = file.Mid(ind+1);
		ext.MakeLower();
		if (ext == _T("dll") || ext == _T("exe"))
			img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, index, icoDll) : (ImageBase*)new IconType(id, file, index, icoDll);
		else if (ext == _T("ico"))
			img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, 0, icoFile) : (ImageBase*)new IconType(id, file, 0, icoFile);
		else if (ext == _T("icl"))
			img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, index, icoIcl) : (ImageBase*)new IconType(id, file, index, icoIcl);
		else if (ext == _T("gif"))
			img = new ImageType(id, file, NULL);
		else if (fei == NULL || ext == _T("tif") || ext == _T("tiff"))
			img = new ImageType(id, file, NULL);
		else
			img = opt.HQScaling ? (ImageBase*)new ImageType(id, file, NULL) : (ImageBase*)new ImageFType(id, file);

		g_imagecache.insert(img);

		if (timerId == 0) {
			timerId = 0xffffffff;
			CallFunctionAsync(sttMainThreadCallback, NULL);
		}
	}
	else img->AddRef();

	ReleaseMutex(g_hMutexIm);

	return img;
}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:42,代码来源:imagecache.cpp

示例15: VoiceRegister

static INT_PTR VoiceRegister(WPARAM wParam, LPARAM lParam)
{
	VOICE_MODULE *in = (VOICE_MODULE *) wParam;
	if (in == NULL || in->cbSize < sizeof(VOICE_MODULE) || in->name == NULL || in->description == NULL)
		return -1;

	if (FindModule(in->name) != NULL)
		return -2;

	if (!ProtoServiceExists(in->name, PS_VOICE_CALL)
			|| !ProtoServiceExists(in->name, PS_VOICE_ANSWERCALL)
			|| !ProtoServiceExists(in->name, PS_VOICE_DROPCALL))
		return -3;

	modules.insert(new VoiceProvider(in->name, in->description, in->flags, in->icon));

	if (hwnd_frame != NULL)
		PostMessage(hwnd_frame, WMU_REFRESH, 0, 0);

	return 0;
}
开发者ID:Robyer,项目名称:miranda-plugins,代码行数:21,代码来源:voiceservice.cpp


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