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


C++ DBDeleteContactSetting函数代码示例

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


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

示例1: Proto_RemoveFromContact

static INT_PTR Proto_RemoveFromContact(WPARAM wParam,LPARAM lParam)
{
	int i;
	DBVARIANT dbv;
	char str[10];

	i = Proto_IsProtoOnContact(wParam,lParam);
	if(!i) return 1;
	if(i==-1)
		DBDeleteContactSetting((HANDLE)wParam,"Protocol","p");
	else {
		for(i--;;i++) {			//we have to decrease i, as Proto_IsOnContact returns +1 more number than read from database
			_itoa(i+1,str,10);
			if(0!=DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) {
				_itoa(i,str,10);
				DBDeleteContactSetting((HANDLE)wParam,"_Filter",str);
				break;
			}
			_itoa(i,str,10);
			DBWriteContactSettingString((HANDLE)wParam,"_Filter",str,dbv.pszVal);
			mir_free(dbv.pszVal);
		}
	}
	return 0;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:25,代码来源:protochains.cpp

示例2: write_ping_address

void write_ping_address(PINGADDRESS *i) {
	bool is_contact = (bool)(CallService(MS_DB_CONTACT_IS, (WPARAM)i->hContact, 0) != 0);

	if(!is_contact) {
		//MessageBox(0, "Creating contact", "Ping", MB_OK);
		i->hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
		CallService( MS_PROTO_ADDTOCONTACT, ( WPARAM )i->hContact, ( LPARAM )PROTO );	
		CallService(MS_IGNORE_IGNORE, (WPARAM)i->hContact, (WPARAM)IGNOREEVENT_USERONLINE);
	}
	DBWriteContactSettingString(i->hContact, PROTO, "Address", i->pszName);
	set_changing_clist_handle(TRUE);
	DBWriteContactSettingString(i->hContact, "CList", "MyHandle", i->pszLabel);
	set_changing_clist_handle(FALSE);
	DBWriteContactSettingString(i->hContact, PROTO, "Nick", i->pszLabel);
	DBWriteContactSettingWord(i->hContact, PROTO, "Status", i->status);
	DBWriteContactSettingDword(i->hContact, PROTO, "Port", i->port);
	DBWriteContactSettingString(i->hContact, PROTO, "Proto", i->pszProto);
	if(strlen(i->pszCommand))
		DBWriteContactSettingString(i->hContact, PROTO, "Command", i->pszCommand);
	else
		DBDeleteContactSetting(i->hContact, PROTO, "Command");
	if(strlen(i->pszParams))
		DBWriteContactSettingString(i->hContact, PROTO, "CommandParams", i->pszParams);
	else
		DBDeleteContactSetting(i->hContact, PROTO, "CommandParams");
	DBWriteContactSettingWord(i->hContact, PROTO, "SetStatus", i->set_status);
	DBWriteContactSettingWord(i->hContact, PROTO, "GetStatus", i->get_status);
	DBWriteContactSettingWord(i->hContact, PROTO, "Index", i->index);
	if(strlen(i->pszCListGroup))
		DBWriteContactSettingString(i->hContact, "CList", "Group", i->pszCListGroup);
	else
		DBDeleteContactSetting(i->hContact, "CList", "Group");
}
开发者ID:darkscout,项目名称:sje-miranda-plugins,代码行数:33,代码来源:pinglist.cpp

示例3: add_contact

HANDLE add_contact(char *name, DWORD flags) {
	HANDLE hContact;

	// already on list?
	if (hContact=find_contact(name)) {
		if (!(flags & PALF_TEMPORARY) && DBGetContactSettingByte(hContact, "CList", "NotOnList", 1)) {
			DBDeleteContactSetting( hContact, "CList", "NotOnList" );
			DBDeleteContactSetting( hContact, "CList", "Hidden" );
		}
		LOG(("add_contact: Found %s", name));
		return hContact; // already there, return handle
	}
	// no, so add
	
	LOG(("add_contact: Adding %s", name));
	hContact=(HANDLE)CallServiceSync(MS_DB_CONTACT_ADD, 0, 0);
	if (hContact) {
		if (CallServiceSync(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact,(LPARAM)SKYPE_PROTONAME)!=0) {
			LOG(("add_contact: Ouch! MS_PROTO_ADDTOCONTACT failed for some reason"));
			CallServiceSync(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
			return NULL;
		}
		if (name[0]) DBWriteContactSettingString(hContact, SKYPE_PROTONAME, SKYPE_NAME, name);

   		if (flags & PALF_TEMPORARY ) {
			DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
			DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
		}
		if (name[0]) {
			SkypeSend("GET USER %s DISPLAYNAME", name);
		} else {LOG(("add_contact: Info: The contact added has no name."));}
	} else {LOG(("add_contact: Ouch! MS_DB_CONTACT_ADD failed for some reason"));}
	LOG(("add_contact succeeded"));
	return hContact;
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:35,代码来源:contacts.c

示例4: MSN_HContactFromEmail

HANDLE CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD flags)
{
	HANDLE hContact = MSN_HContactFromEmail(email, nick, true, flags & PALF_TEMPORARY);

	if (flags & PALF_TEMPORARY) 
	{
		if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1) 
			DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
	}
	else 
	{
		DBDeleteContactSetting(hContact, "CList", "Hidden");
		if (msnLoggedIn) 
		{
//			int netId = Lists_GetNetId(email);
//			if (netId == NETID_UNKNOWN)
			int netId = strncmp(email, "tel:", 4) ? NETID_MSN : NETID_MOB;
			if (MSN_AddUser(hContact, email, netId, LIST_FL))
			{
				MSN_AddUser(hContact, email, netId, LIST_PL + LIST_REMOVE);
				MSN_AddUser(hContact, email, netId, LIST_BL + LIST_REMOVE);
				MSN_AddUser(hContact, email, netId, LIST_AL);
				DBDeleteContactSetting(hContact, "CList", "Hidden");
			}
			MSN_SetContactDb(hContact, email);

			if (MSN_IsMeByContact(hContact)) displayEmailCount(hContact);
		}
		else hContact = NULL;
	}
	return hContact;
}
开发者ID:sportarup,项目名称:miranda-dev,代码行数:32,代码来源:msn_proto.cpp

示例5: logoff_contacts

void logoff_contacts(BOOL bCleanup) {
	HANDLE hContact;
	char *szProto;
	DBVARIANT dbv={0};

	LOG(("logoff_contacts: Logging off contacts."));
	for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
		szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
		if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME))
		{
			if (DBGetContactSettingWord(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE)!=ID_STATUS_OFFLINE)
				DBWriteContactSettingWord(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE);

			DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "CallId");
			if (DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==1)
			{
				if (DBGetContactSettingTString(hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv)) continue;
				RemChat (dbv.ptszVal);
				DBFreeVariant(&dbv);
			}
			if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, "Typing_Stream", &dbv) == 0)
			{
				if (bCleanup) SkypeSend ("ALTER APPLICATION libpurple_typing DISCONNECT %s", dbv.pszVal);
				DBFreeVariant(&dbv);
				DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "Typing_Stream");
			}

		}
	}
	if (bCleanup && (protocol>=5 || bIsImoproxy)) SkypeSend ("DELETE APPLICATION libpurple_typing");
}
开发者ID:BackupTheBerlios,项目名称:mgoodies-svn,代码行数:31,代码来源:contacts.c

示例6: ICQserverImport

static void ICQserverImport()
{
	// Clear last update stamp
	DBDeleteContactSetting(NULL, szICQModuleName[ iICQAccount ], "SrvLastUpdate");
	DBDeleteContactSetting(NULL, szICQModuleName[ iICQAccount ], "SrvRecordCount");

	// Enable contacts downloading
	DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "UseServerCList", 1);
	DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "AddServerNew", 1);
	DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "UseServerNicks", 1);
	DBWriteContactSettingByte(NULL, szICQModuleName[ iICQAccount ], "ServerAddRemove", 1);
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:12,代码来源:ICQserver.c

示例7: RemoveAvatar

static void RemoveAvatar(HANDLE hContact) {
	char tFileName[ MAX_PATH ];
	if (hContact == NULL) {
		jabberThreadInfo->avatarHash[0] = '\0';
	}
	TlenGetAvatarFileName( NULL, tFileName, sizeof tFileName );
	DeleteFileA(tFileName);
	DBDeleteContactSetting(hContact, "ContactPhoto", "File");
	DBDeleteContactSetting(hContact, jabberProtoName, "AvatarHash");
	DBDeleteContactSetting(hContact, jabberProtoName, "AvatarFormat");
	ProtoBroadcastAck(jabberProtoName, NULL, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
}
开发者ID:BackupTheBerlios,项目名称:mtlen-svn,代码行数:12,代码来源:tlen_avatar.c

示例8: replaceSetting

int replaceSetting(HWND hwnd, HANDLE hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
{
	DBCONTACTWRITESETTING cws;
	char *myreplace = NULL;
	int count = 0;
	DBVARIANT dbv2;

	if (!dbv->type)	return 0;

	if (mode & RW_FULL)
		cws.szSetting = (char*)replace;
	else
	{
		myreplace = multiReplace(setting, find, replace, mode & RW_CASE);
		cws.szSetting = myreplace;
	}

	if (cws.szSetting[0]==0)
	{
		ItemFound(hwnd,hContact,module,setting,NULL,FW_SETTINGNAME|FW_DELETED);
		DBDeleteContactSetting(hContact,module,setting);
		mir_free(myreplace);
		return 1;
	}

	// check & write
	if (GetSetting(hContact, module, myreplace, &dbv2))
	{
		cws.szModule=module;
		cws.value.type=dbv->type;
		cws.value.pszVal=dbv->pszVal;
		cws.value.bVal=dbv->bVal;
		cws.value.wVal=dbv->wVal;
		cws.value.dVal=dbv->dVal;
		cws.value.pbVal = dbv->pbVal;
		cws.value.cpbVal = dbv->cpbVal;

		if (!CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws))
		{
			count++;
			DBDeleteContactSetting(hContact,module,setting);
			ItemFound(hwnd,hContact,module,cws.szSetting,NULL,FW_SETTINGNAME|FW_REPLACED);
		}
	}
	else
		DBFreeVariant(&dbv2);

	mir_free(myreplace);

	return count;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:51,代码来源:findwindow.cpp

示例9: Service_PGPsetKey

INT_PTR __cdecl Service_PGPsetKey(WPARAM wParam, LPARAM lParam) {

    BOOL del = true;
    if(bPGPloaded) {
        if(bPGPkeyrings) {
            char szKeyID[128];
            szKeyID[0]='\0';
            PVOID KeyID = pgp_select_keyid(GetForegroundWindow(),szKeyID);
            if(szKeyID[0]) {
                DBDeleteContactSetting((HANDLE)wParam,szModuleName,"pgp");
                DBCONTACTWRITESETTING cws;
                memset(&cws,0,sizeof(cws));
                cws.szModule = szModuleName;
                cws.szSetting = "pgp";
                cws.value.type = DBVT_BLOB;
                cws.value.pbVal = (LPBYTE)KeyID;
                cws.value.cpbVal = pgp_size_keyid();
                CallService(MS_DB_CONTACT_WRITESETTING,wParam,(LPARAM)&cws);
                DBWriteContactSettingByte((HANDLE)wParam,szModuleName,"pgp_mode",0);
                DBWriteContactSettingString((HANDLE)wParam,szModuleName,"pgp_abbr",szKeyID);
                del = false;
            }
        }
        else if(bPGPprivkey) {
            char KeyPath[MAX_PATH];
            KeyPath[0]='\0';
            if(ShowSelectKeyDlg(0,KeyPath)) {
                char *publ = LoadKeys(KeyPath,false);
                if(publ) {
                    DBDeleteContactSetting((HANDLE)wParam,szModuleName,"pgp");
                    myDBWriteStringEncode((HANDLE)wParam,szModuleName,"pgp",publ);
                    DBWriteContactSettingByte((HANDLE)wParam,szModuleName,"pgp_mode",1);
                    DBWriteContactSettingString((HANDLE)wParam,szModuleName,"pgp_abbr","(binary)");
                    mir_free(publ);
                    del = false;
                }
            }
        }
    }

    if(del) Service_PGPdelKey(wParam,lParam);
    else {
        pUinKey ptr = getUinKey((HANDLE)wParam);
        cpp_delete_context(ptr->cntx);
        ptr->cntx=0;
    }
    ShowStatusIconNotify((HANDLE)wParam);
    return 1;
}
开发者ID:aventado,项目名称:secureimplugin,代码行数:49,代码来源:svcs_menu.cpp

示例10: Service_PGPdelKey

INT_PTR __cdecl Service_PGPdelKey(WPARAM wParam, LPARAM lParam) {

    if(bPGPloaded) {
        DBDeleteContactSetting((HANDLE)wParam, szModuleName, "pgp");
        DBDeleteContactSetting((HANDLE)wParam, szModuleName, "pgp_mode");
        DBDeleteContactSetting((HANDLE)wParam, szModuleName, "pgp_abbr");
    }
    {
        pUinKey ptr = getUinKey((HANDLE)wParam);
        cpp_delete_context(ptr->cntx);
        ptr->cntx=0;
    }
    ShowStatusIconNotify((HANDLE)wParam);
    return 1;
}
开发者ID:aventado,项目名称:secureimplugin,代码行数:15,代码来源:svcs_menu.cpp

示例11: Convert

static BOOL Convert(HANDLE hContact, char* module, char* setting, int value, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string
{
    int Result = 1;
	char temp[64];

	switch (toType)
	{
		case 0:
			if (value > 0xFF)
				Result = 0;
			else
				DBWriteContactSettingByte(hContact, module, setting, (BYTE)value);
		break;
		case 1:
			if (value > 0xFFFF)
				Result = 0;
			else
				DBWriteContactSettingWord(hContact, module, setting, (WORD)value);
		break;
		case 2:
			DBWriteContactSettingDword(hContact, module, setting, (DWORD)value);
		break;
		case 3:
			DBDeleteContactSetting(hContact, module, setting);
			DBWriteContactSettingString(hContact, module, setting, itoa(value,temp,10));
		break;
	}
	return Result;
}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:29,代码来源:addeditsettingsdlg.cpp

示例12: RecvFile

int RecvFile(WPARAM wParam, LPARAM lParam)
{
	DBEVENTINFO dbei;
	CCSDATA* ccs = (CCSDATA*)lParam;
	PROTORECVEVENT* pre = (PROTORECVEVENT*)ccs->lParam;
	char* szDesc;
	char* szFile;

	DBDeleteContactSetting(ccs->hContact, "CList", "Hidden");

	szFile = pre->szMessage + sizeof(DWORD);
	szDesc = szFile + strlen(szFile) + 1;

	ZeroMemory(&dbei, sizeof(dbei));
	dbei.cbSize = sizeof(dbei);
	dbei.szModule = PROTO;
	dbei.timestamp = pre->timestamp;
	dbei.flags = (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
	dbei.eventType = EVENTTYPE_FILE;
	dbei.cbBlob = sizeof(DWORD) + strlen(szFile) + strlen(szDesc) + 2;
	dbei.pBlob = (PBYTE)pre->szMessage;

	CallService(MS_DB_EVENT_ADD, (WPARAM)ccs->hContact, (LPARAM)&dbei);

	return 0;
}
开发者ID:MrtsComputers,项目名称:miranda-ng,代码行数:26,代码来源:sametime.cpp

示例13: onSystemOKToExit

int __cdecl onSystemOKToExit(WPARAM wParam,LPARAM lParam) {

    if(bSavePass) {
	LPSTR tmp = gpg_get_passphrases();
	DBWriteContactSettingString(0,szModuleName,"gpgSave",tmp);
	LocalFree(tmp);
    }
    else {
	DBDeleteContactSetting(0,szModuleName,"gpgSave");
    }
	if(bPGPloaded) pgp_done();
	if(bGPGloaded) gpg_done();
	rsa_done();
	while(iHook--) UnhookEvent(g_hHook[iHook]);
	mir_free(g_hHook);
	while(iService--) DestroyServiceFunction(g_hService[iService]);
	mir_free(g_hService);
	DestroyHookableEvent(g_hEvent[0]);
	DestroyHookableEvent(g_hEvent[1]);
	freeContactList();
	free_rtfconv();
#if defined(_DEBUG) || defined(NETLIB_LOG)
	DeinitNetlib();
#endif
	return 0;
}
开发者ID:aventado,项目名称:secureimplugin,代码行数:26,代码来源:main.cpp

示例14: JabberDBAddAuthRequest

void JabberDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick)
{
	char *s;
	PBYTE pCurBlob;
    PBYTE pBlob;
	DWORD cbBlob;
	HANDLE hContact;

	if ((hContact=JabberHContactFromJID(proto, jid)) == NULL) {
		hContact = (HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
		CallService(MS_PROTO_ADDTOCONTACT, (WPARAM) hContact, (LPARAM) proto->iface.m_szModuleName);
        // strip resource if present
        s = JabberLoginFromJID(jid);
        _strlwr(s);
		DBWriteContactSettingString(hContact, proto->iface.m_szModuleName, "jid", s);
        mir_free(s);
	}
	else {
		DBDeleteContactSetting(hContact, proto->iface.m_szModuleName, "Hidden");
	}
	DBWriteContactSettingString(hContact, proto->iface.m_szModuleName, "Nick", nick);
	JabberLog(proto, "auth request: %s, %s", jid, nick);
	//blob is: uin(DWORD), hContact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
	//blob is: 0(DWORD), hContact(HANDLE), nick(ASCIIZ), ""(ASCIIZ), ""(ASCIIZ), email(ASCIIZ), ""(ASCIIZ)
	cbBlob = sizeof(DWORD) + sizeof(HANDLE) + (int)strlen(nick) + (int)strlen(jid) + 5;
	pBlob = pCurBlob = (PBYTE) mir_alloc(cbBlob);
	*((PDWORD) pCurBlob) = 0; pCurBlob += sizeof(DWORD);
	*((PHANDLE) pCurBlob) = hContact; pCurBlob += sizeof(HANDLE);
	strcpy((char *) pCurBlob, nick); pCurBlob += strlen(nick)+1;
	*pCurBlob = '\0'; pCurBlob++;		//firstName
	*pCurBlob = '\0'; pCurBlob++;		//lastName
	strcpy((char *) pCurBlob, jid); pCurBlob += strlen(jid)+1;
	*pCurBlob = '\0';					//reason
    JabberDBAddEvent(proto, NULL, EVENTTYPE_AUTHREQUEST, 0, pBlob, cbBlob);
}
开发者ID:BackupTheBerlios,项目名称:mtlen-svn,代码行数:35,代码来源:jabber_misc.c

示例15: SM_SetStatus

BOOL SM_SetStatus(const TCHAR* pszID, const char* pszModule, int wStatus)
{
	SESSION_INFO *pTemp = m_WndList, *pLast = NULL;

	if (!pszModule)
		return FALSE;

	while ( pTemp != NULL ) {
		if (( !pszID || !lstrcmpi( pTemp->ptszID, pszID )) && !lstrcmpiA( pTemp->pszModule, pszModule )) {
			pTemp->wStatus = wStatus;
			if (pTemp->hWnd && g_Settings.TabsEnable)
				g_TabSession.wStatus = wStatus;

			if ( pTemp->hContact ) {
				if ( pTemp->iType != GCW_SERVER && wStatus != ID_STATUS_OFFLINE )
						DBDeleteContactSetting(pTemp->hContact, "CList", "Hidden");

				DBWriteContactSettingWord(pTemp->hContact, pTemp->pszModule, "Status", (WORD)wStatus);
			}

			if ( g_Settings.TabsEnable && g_TabSession.hWnd )
				PostMessage( g_TabSession.hWnd, GC_FIXTABICONS, 0, (LPARAM) pTemp );

			if (pszID)
				return TRUE;
		}
		pLast = pTemp;
		pTemp = pTemp->next;
	}
	return TRUE;
}
开发者ID:dineshkummarc,项目名称:miranda-im-v0.9.47-src,代码行数:31,代码来源:manager.c


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