本文整理汇总了C++中DBWriteContactSettingString函数的典型用法代码示例。如果您正苦于以下问题:C++ DBWriteContactSettingString函数的具体用法?C++ DBWriteContactSettingString怎么用?C++ DBWriteContactSettingString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DBWriteContactSettingString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveSessionMark
void RemoveSessionMark(HANDLE hContact,int mode,int marknum)
{
unsigned int i=1;
char temp_1[1]={'\0'},temp_2[1]={'\0'};
char szDst[256]={'\0'};
if(mode==0)
{
DBVARIANT dbv;
if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
{
for (i=marknum;i<ses_limit;i++)
dbv.pszVal[i]=dbv.pszVal[i+1];
for (i=ses_limit;i<10;i++)
dbv.pszVal[i]='0';
DBWriteContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", dbv.pszVal);
DBFreeVariant(&dbv);
}
}
if (mode==1)
{
DBVARIANT dbv;
if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
{
for (i=marknum;i<ses_limit;i++)
dbv.pszVal[i]=dbv.pszVal[i+1];
DBWriteContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", dbv.pszVal);
DBFreeVariant(&dbv);
}
}
}
示例2: SetInSessionOrder
void SetInSessionOrder(HANDLE hContact,int mode,int count,unsigned int ordernum)
{
int iOrder=0;
char szTemp[3]={'\0'};
if(ordernum<10)
mir_snprintf(szTemp, SIZEOF(szTemp), "%u%u", 0, ordernum);
else
mir_snprintf(szTemp, SIZEOF(szTemp), "%u", ordernum);
if(mode==0)
{
DBVARIANT dbv;
if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsOrder", &dbv) && dbv.pszVal)
{
dbv.pszVal[count*2]=szTemp[0];
dbv.pszVal[count*2+1]=szTemp[1];
DBWriteContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsOrder", dbv.pszVal);
DBFreeVariant(&dbv);
}
}
if (mode==1)
{
DBVARIANT dbv;
if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsOrder", &dbv) && dbv.pszVal)
{
dbv.pszVal[count*2]=szTemp[0];
dbv.pszVal[count*2+1]=szTemp[1];
DBWriteContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsOrder", dbv.pszVal);
DBFreeVariant(&dbv);
}
}
}
示例3: RefreshContact
//Function to put all enabled contact to the Online status
void RefreshContact(void)
{
HACCOUNT Finder;
for(Finder=POP3Plugin->FirstAccount;Finder!=NULL;Finder=Finder->Next)
{
if(Finder->hContact != NULL)
{
if((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT))
{
DBDeleteContactSetting(Finder->hContact, "CList", "Hidden");
}
else
{
DBWriteContactSettingByte(Finder->hContact, "CList", "Hidden", 1);
}
}
else
{
if((Finder->Flags & YAMN_ACC_ENA) && (Finder->NewMailN.Flags & YAMN_ACC_CONT))
{
Finder->hContact =(HANDLE) CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT,(WPARAM)Finder->hContact,(LPARAM)ProtoName);
DBWriteContactSettingString(Finder->hContact,ProtoName,"Id",Finder->Name);
DBWriteContactSettingString(Finder->hContact,ProtoName,"Nick",Finder->Name);
DBWriteContactSettingString(Finder->hContact,"Protocol","p",ProtoName);
DBWriteContactSettingWord(Finder->hContact, ProtoName, "Status", ID_STATUS_ONLINE);
DBWriteContactSettingString(Finder->hContact, "CList", "StatusMsg", Translate("No new mail message"));
}
}
}
}
示例4: 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);
}
示例5: SetSessionMark
void SetSessionMark(HANDLE hContact,int mode,char bit,unsigned int marknum)
{
char* pszBuffer=NULL;
if(mode==0)
{
DBVARIANT dbv;
if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
{
dbv.pszVal[marknum]=bit;
DBWriteContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", dbv.pszVal);
DBFreeVariant(&dbv);
}
}
if (mode==1)
{
DBVARIANT dbv;
if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
{
pszBuffer = mir_strdup(dbv.pszVal);
pszBuffer[marknum]=bit;
DBWriteContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", pszBuffer);
mir_free(pszBuffer);
DBFreeVariant(&dbv);
}
}
}
示例6: MTG_DOMOVE
static int MTG_DOMOVE(WPARAM wParam,LPARAM lParam)
{
char *grpname,*correctgrpname;
char *intname;
if (lParam==0)
{
MessageBoxA(0,"Wrong version of New menu system - please update.","MoveToGroup",0);
return(0);
};
lParam--;
if (lParam==-2)//root level
{
DBWriteContactSettingString((HANDLE)wParam,"CList","Group","");
return 0;
}
intname=(char *)malloc(20);
itoa(lParam,intname,10);
grpname=DBGetStringA(0,"CListGroups",intname);
if (grpname!=0)
{
correctgrpname=&(grpname[1]);
DBWriteContactSettingString((HANDLE)wParam,"CList","Group",correctgrpname);
mir_free(grpname);
};
free (intname);
return 0;
};
示例7: AddSessionMark
void AddSessionMark(HANDLE hContact,int mode,char bit)
{
unsigned int i;
char temp_1[1]={'\0'},temp_2[1]={'\0'};
char szDst[256]={'\0'};
char* pszBuffer=NULL;
if(mode==0)
{
DBVARIANT dbv;
if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", &dbv) && dbv.pszVal)
{
temp_1[0]=dbv.pszVal[0];
for (i=0;i<ses_limit;i++)
{
temp_2[0]=dbv.pszVal[i+1];
dbv.pszVal[i+1]=temp_1[0];
temp_1[0]=temp_2[0];
}
for (i=ses_limit;i<10;i++)
dbv.pszVal[i]='0';
dbv.pszVal[0]=bit;
DBWriteContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", dbv.pszVal);
DBFreeVariant(&dbv);
}
else if(bit=='1') DBWriteContactSettingString(hContact, __INTERNAL_NAME, "LastSessionsMarks", "10000000000");
}
if (mode==1)
{
DBVARIANT dbv;
if(!DBGetContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", &dbv) && dbv.pszVal)
{
if(strlen(dbv.pszVal)<g_ses_count)
{
pszBuffer = (char*)mir_alloc(g_ses_count+1);
ZeroMemory(pszBuffer,g_ses_count+1);
strcpy(pszBuffer,dbv.pszVal);
}
else
pszBuffer = mir_strdup(dbv.pszVal);
DBFreeVariant(&dbv);
temp_1[0]=pszBuffer[0];
for (i=0;i<g_ses_count;i++)
{
temp_2[0]=pszBuffer[i+1];
pszBuffer[i+1]=temp_1[0];
temp_1[0]=temp_2[0];
}
pszBuffer[0]=bit;
DBWriteContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", pszBuffer);
mir_free(pszBuffer);
}
else if(bit=='1')DBWriteContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", "10000000000");
else DBWriteContactSettingString(hContact, __INTERNAL_NAME, "UserSessionsMarks", "00000000000");
}
}
示例8: SkypeProfile_Save
void SkypeProfile_Save(SkypeProfile *pstProf)
{
DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "Gender", pstProf->Sex);
DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "HomePhone", pstProf->HomePhone);
DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "OfficePhone", pstProf->OfficePhone);
DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "HomePage", pstProf->HomePage);
DBWriteContactSettingTString(NULL, SKYPE_PROTONAME, "Nick", pstProf->FullName);
DBWriteContactSettingTString(NULL, SKYPE_PROTONAME, "City", pstProf->City);
DBWriteContactSettingTString(NULL, SKYPE_PROTONAME, "Province", pstProf->Province);
DBWriteContactSettingWord(NULL, SKYPE_PROTONAME, "BirthYear", (WORD)pstProf->Birthday.wYear);
DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "BirthMonth", (BYTE)pstProf->Birthday.wMonth);
DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "BirthDay", (BYTE)pstProf->Birthday.wDay);
}
示例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;
}
示例10: Proto_AddToContact
static INT_PTR Proto_AddToContact(WPARAM wParam,LPARAM lParam)
{
PROTOCOLDESCRIPTOR *pd,*pdCompare;
pd = Proto_IsProtocolLoaded(( char* )lParam );
if ( pd == NULL ) {
PROTOACCOUNT* pa = Proto_GetAccount(( char* )lParam );
if ( pa ) {
DBWriteContactSettingString((HANDLE)wParam,"Protocol","p",(char*)lParam);
return 0;
}
return 1;
}
if ( pd->type == PROTOTYPE_PROTOCOL ) {
DBWriteContactSettingString((HANDLE)wParam,"Protocol","p",(char*)lParam);
return 0;
}
if(Proto_IsProtoOnContact(wParam,lParam)) return 1;
{ /* v:0.3.3 + PROTO FILTERS ARE NOW KEPT IN THEIR OWN DB MODULE! */
int i;
char str[10],*lastProto;
DBVARIANT dbv;
for(i=0;;i++) {
_itoa(i,str,10);
if(DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) break;
pdCompare = Proto_IsProtocolLoaded(( char* )dbv.pszVal );
mir_free(dbv.pszVal);
if(pdCompare==NULL) continue;
if(pd->type > pdCompare->type) break;
}
//put the new module at position i
lastProto=mir_strdup((char*)lParam);
for(;;i++) {
_itoa(i,str,10);
if(DBGetContactSettingString((HANDLE)wParam,"_Filter",str,&dbv)) {
DBWriteContactSettingString((HANDLE)wParam,"_Filter",str,lastProto);
mir_free(lastProto);
break;
}
DBWriteContactSettingString((HANDLE)wParam,"_Filter",str,lastProto);
mir_free(lastProto);
lastProto=dbv.pszVal;
}
}
return 0;
}
示例11: memset
static TlenProtocol *tlenProtoInit( const char* pszProtoName, const TCHAR* tszUserName )
{
DBVARIANT dbv;
char text[_MAX_PATH];
TlenProtocol *proto = (TlenProtocol *)mir_alloc(sizeof(TlenProtocol));
memset(proto, 0, sizeof(TlenProtocol));
proto->iface.m_tszUserName = mir_tstrdup( tszUserName );
proto->iface.m_szModuleName = mir_strdup(pszProtoName);
proto->iface.m_szProtoName = mir_strdup(pszProtoName);
_strlwr( proto->iface.m_szProtoName );
proto->iface.m_szProtoName[0] = toupper( proto->iface.m_szProtoName[0] );
proto->iface.m_iStatus = ID_STATUS_OFFLINE;
TlenInitServicesVTbl(proto);
InitializeCriticalSection(&proto->modeMsgMutex);
InitializeCriticalSection(&proto->csSend);
sprintf(text, "%s/%s", proto->iface.m_szModuleName, "Nudge");
proto->hTlenNudge = CreateHookableEvent(text);
HookEventObj_Ex(ME_SYSTEM_MODULESLOADED, proto, TlenSystemModulesLoaded);
HookEventObj_Ex(ME_OPT_INITIALISE, proto, TlenOptionsInit);
HookEventObj_Ex(ME_DB_CONTACT_SETTINGCHANGED, proto, JabberDbSettingChanged);
HookEventObj_Ex(ME_DB_CONTACT_DELETED, proto, JabberContactDeleted);
HookEventObj_Ex(ME_CLIST_PREBUILDCONTACTMENU, proto, TlenPrebuildContactMenu);
// HookEventObj_Ex(ME_SKIN2_ICONSCHANGED, proto, TlenIconsChanged);
HookEventObj_Ex(ME_SYSTEM_PRESHUTDOWN, proto, TlenPreShutdown);
if (!DBGetContactSetting(NULL, proto->iface.m_szModuleName, "LoginServer", &dbv)) {
DBFreeVariant(&dbv);
} else {
DBWriteContactSettingString(NULL, proto->iface.m_szModuleName, "LoginServer", "tlen.pl");
}
if (!DBGetContactSetting(NULL, proto->iface.m_szModuleName, "ManualHost", &dbv)) {
DBFreeVariant(&dbv);
} else {
DBWriteContactSettingString(NULL, proto->iface.m_szModuleName, "ManualHost", "s1.tlen.pl");
}
TlenLoadOptions(proto);
JabberWsInit(proto);
JabberSerialInit(proto);
JabberIqInit(proto);
JabberListInit(proto);
return proto;
}
示例12: MainInit
int MainInit(WPARAM wparam,LPARAM lparam)
{
HookEvent(ME_OPT_INITIALISE,OptionsInit);
if(DBGetContactSettingByte(NULL,S_MOD,"MenuItem",1)) {
InitMenuitem();
}
if(DBGetContactSettingByte(NULL,S_MOD,"UserinfoTab",1))
ehuserinfo=HookEvent(ME_USERINFO_INITIALISE,UserinfoInit);
if(DBGetContactSettingByte(NULL,S_MOD,"FileOutput",0))
InitFileOutput();
if(DBGetContactSettingByte(NULL,S_MOD,"MissedOnes",0))
ehmissed_proto=HookEvent(ME_PROTO_ACK,ModeChange_mo);
SetOffline();
ehdb=HookEvent(ME_DB_CONTACT_SETTINGCHANGED,UpdateValues);
ehproto[0]=HookEvent(ME_PROTO_ACK,ModeChange);
ehproto[1]=HookEvent(ME_PROTO_ACK,GetInfoAck);
SkinAddNewSound("LastSeenTrackedStatusChange",Translate("LastSeen: User status change"),"global.wav");
DBWriteContactSettingString(NULL,"Uninstall",Translate("Last seen"),S_MOD);
return 0;
}
示例13: JabberContactListCreateClistGroup
static void JabberContactListCreateClistGroup(char *groupName)
{
char str[33], newName[128];
int i;
DBVARIANT dbv;
char *name;
for (i=0;;i++) {
itoa(i, str, 10);
if (DBGetContactSetting(NULL, "CListGroups", str, &dbv))
break;
name = dbv.pszVal;
if (name[0]!='\0' && !strcmp(name+1, groupName)) {
// Already exist, no need to create
DBFreeVariant(&dbv);
return;
}
DBFreeVariant(&dbv);
}
// Create new group with id = i (str is the text representation of i)
newName[0] = 1 | GROUPF_EXPANDED;
strncpy(newName+1, groupName, sizeof(newName)-1);
newName[sizeof(newName)-1] = '\0';
DBWriteContactSettingString(NULL, "CListGroups", str, newName);
CallService(MS_CLUI_GROUPADDED, i+1, 0);
}
示例14: getSettingName
void MirandaSkinnedDialog::setSettting(const char *name, const char *val, bool global)
{
char setting[SETTING_NAME_SIZE];
getSettingName(setting, name, global);
DBWriteContactSettingString(NULL, getModule(), setting, val);
}
示例15: 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;
}