diff options
-rw-r--r-- | worldtime_protocol/common.h | 1 | ||||
-rw-r--r-- | worldtime_protocol/options.cpp | 56 | ||||
-rw-r--r-- | worldtime_protocol/time_display.cpp | 34 | ||||
-rw-r--r-- | worldtime_protocol/timezone.cpp | 16 | ||||
-rw-r--r-- | worldtime_protocol/timezone.h | 6 | ||||
-rw-r--r-- | worldtime_protocol/timezone_list.cpp | 16 | ||||
-rw-r--r-- | worldtime_protocol/timezone_list.h | 2 | ||||
-rw-r--r-- | worldtime_protocol/worldtimeproto.cpp | 60 | ||||
-rw-r--r-- | worldtime_protocol/worldtimeproto_9.vcproj | 4 |
9 files changed, 97 insertions, 98 deletions
diff --git a/worldtime_protocol/common.h b/worldtime_protocol/common.h index 7a5e23a..cc020f6 100644 --- a/worldtime_protocol/common.h +++ b/worldtime_protocol/common.h @@ -14,6 +14,7 @@ #define PROTO "WorldTime"
+#include <win2k.h>
#include <newpluginapi.h>
#include <statusmodes.h>
#include <m_options.h>
diff --git a/worldtime_protocol/options.cpp b/worldtime_protocol/options.cpp index 071c88c..d98652a 100644 --- a/worldtime_protocol/options.cpp +++ b/worldtime_protocol/options.cpp @@ -30,7 +30,7 @@ LISTITEM add_edit_item; INT_PTR CALLBACK DlgProcOptsEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
HWND hw;
int sel;
- char buf[MAX_NAME_LENGTH];
+ TCHAR buf[MAX_NAME_LENGTH];
switch ( msg ) {
case WM_INITDIALOG:
@@ -82,8 +82,8 @@ INT_PTR CALLBACK DlgProcOptsEdit(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_ED_LABEL:
GetDlgItemText(hwndDlg, IDC_ED_LABEL, buf, MAX_NAME_LENGTH);
hw = GetDlgItem(hwndDlg, IDOK);
- EnableWindow(hw, (strlen(buf) > 0));
- strncpy(add_edit_item.pszText, buf, MAX_NAME_LENGTH);
+ EnableWindow(hw, (_tcslen(buf) > 0));
+ _tcsncpy(add_edit_item.pszText, buf, MAX_NAME_LENGTH);
}
}
@@ -136,16 +136,16 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA bool hide_proto = (DBGetContactSettingByte(NULL, "WorldTime", "HideProtocol", 0) == 1);
CheckDlgButton(hwndDlg, IDC_CHK_HIDE, hide_proto ? 1 : 0);
DBVARIANT dbv;
- if(!DBGetContactSetting(NULL, "WorldTime", "TimeFormat", &dbv))
- strcpy(format_string, dbv.pszVal);
+ if(!DBGetContactSettingTString(NULL, "WorldTime", "TimeFormat", &dbv))
+ _tcscpy(format_string, dbv.ptszVal);
DBFreeVariant(&dbv);
SetDlgItemText(hwndDlg, IDC_ED_FORMAT, format_string);
- if(!DBGetContactSetting(NULL, "WorldTime", "DateFormat", &dbv))
- strcpy(date_format_string, dbv.pszVal);
+ if(!DBGetContactSettingTString(NULL, "WorldTime", "DateFormat", &dbv))
+ _tcscpy(date_format_string, dbv.ptszVal);
DBFreeVariant(&dbv);
SetDlgItemText(hwndDlg, IDC_ED_DATE_FORMAT, date_format_string);
- if(!DBGetContactSetting(NULL, "WorldTime", "CListFormat", &dbv))
- strcpy(clist_format_string, dbv.pszVal);
+ if(!DBGetContactSettingTString(NULL, "WorldTime", "CListFormat", &dbv))
+ _tcscpy(clist_format_string, dbv.ptszVal);
DBFreeVariant(&dbv);
SetDlgItemText(hwndDlg, IDC_ED_CLIST_FORMAT, clist_format_string);
@@ -257,18 +257,18 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hide_proto = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDE) == BST_CHECKED;
DBWriteContactSettingByte(NULL, "WorldTime", "HideProtocol", hide_proto ? 1 : 0);
- char buf[512];
+ TCHAR buf[512];
GetDlgItemText(hwndDlg, IDC_ED_FORMAT, buf, 512);
- DBWriteContactSettingString(NULL, "WorldTime", "TimeFormat", buf);
- strncpy(format_string, buf, 512);
+ DBWriteContactSettingTString(NULL, "WorldTime", "TimeFormat", buf);
+ _tcsncpy(format_string, buf, 512);
GetDlgItemText(hwndDlg, IDC_ED_DATE_FORMAT, buf, 512);
- DBWriteContactSettingString(NULL, "WorldTime", "DateFormat", buf);
- strncpy(date_format_string, buf, 512);
+ DBWriteContactSettingTString(NULL, "WorldTime", "DateFormat", buf);
+ _tcsncpy(date_format_string, buf, 512);
GetDlgItemText(hwndDlg, IDC_ED_CLIST_FORMAT, buf, 512);
- DBWriteContactSettingString(NULL, "WorldTime", "CListFormat", buf);
- strncpy(clist_format_string, buf, 512);
+ DBWriteContactSettingTString(NULL, "WorldTime", "CListFormat", buf);
+ _tcsncpy(clist_format_string, buf, 512);
copy_listbox_items(listbox_items, temp_listbox_items);
save_listbox_items();
@@ -287,9 +287,9 @@ int OptInit(WPARAM wParam,LPARAM lParam) odp.cbSize = sizeof(odp);
odp.position = -790000000;
odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCE(IDD_DIALOG1);
- odp.pszTitle = Translate("World Time");
- odp.pszGroup = Translate("Plugins");
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG1);
+ odp.pszTitle = "World Time Protocol";
+ odp.pszGroup = "Plugins";
odp.flags = ODPF_BOLDGROUPS;
odp.nIDBottomSimpleControl = IDC_PPM;
odp.pfnDlgProc = DlgProcOpts;
@@ -303,20 +303,20 @@ void LoadOptions() { hide_proto = (DBGetContactSettingByte(NULL, "WorldTime", "HideProtocol", 0) == 1);
DBVARIANT dbv;
- if(!DBGetContactSetting(NULL, "WorldTime", "TimeFormat", &dbv)) {
- strncpy(format_string, dbv.pszVal, 512);
+ if(!DBGetContactSettingTString(NULL, "WorldTime", "TimeFormat", &dbv)) {
+ _tcsncpy(format_string, dbv.ptszVal, 512);
} else
- strcpy(format_string, "HH:mm");
+ _tcscpy(format_string, _T("HH:mm"));
DBFreeVariant(&dbv);
- if(!DBGetContactSetting(NULL, "WorldTime", "DateFormat", &dbv)) {
- strncpy(date_format_string, dbv.pszVal, 512);
+ if(!DBGetContactSettingTString(NULL, "WorldTime", "DateFormat", &dbv)) {
+ _tcsncpy(date_format_string, dbv.ptszVal, 512);
} else
- strcpy(date_format_string, "d/M");
+ _tcscpy(date_format_string, _T("d/M"));
DBFreeVariant(&dbv);
- if(!DBGetContactSetting(NULL, "WorldTime", "CListFormat", &dbv)) {
- strncpy(clist_format_string, dbv.pszVal, 512);
+ if(!DBGetContactSettingTString(NULL, "WorldTime", "CListFormat", &dbv)) {
+ _tcsncpy(clist_format_string, dbv.ptszVal, 512);
} else
- strcpy(clist_format_string, "%n: %t %d");
+ _tcscpy(clist_format_string, _T("%n: %t %d"));
DBFreeVariant(&dbv);
}
diff --git a/worldtime_protocol/time_display.cpp b/worldtime_protocol/time_display.cpp index f49cde7..064ff45 100644 --- a/worldtime_protocol/time_display.cpp +++ b/worldtime_protocol/time_display.cpp @@ -43,9 +43,9 @@ void UnloadFonts() { typedef struct WindowData_tag {
HANDLE hContact;
int timezone_list_index;
- char time_buff[32];
- char date_buff[128];
- char nick_buff[256];
+ TCHAR time_buff[32];
+ TCHAR date_buff[128];
+ TCHAR nick_buff[256];
TIME_ZONE_INFORMATION tzi;
} WindowData;
@@ -77,10 +77,10 @@ INT_PTR CALLBACK DlgProcDisplay(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP RECT br = r, lr = r;
br.bottom -= (r.bottom - r.top) / 4;
oldFont = (HFONT)SelectObject(hdc, hBigFont);
- DrawText(hdc, wd->time_buff, (int)strlen(wd->time_buff), &br, DT_SINGLELINE | DT_VCENTER | DT_CENTER);
+ DrawText(hdc, wd->time_buff, (int)_tcslen(wd->time_buff), &br, DT_SINGLELINE | DT_VCENTER | DT_CENTER);
SelectObject(hdc, hNormalFont);
lr.top = (r.bottom - r.top) * 3 / 4;
- DrawText(hdc, wd->date_buff, (int)strlen(wd->date_buff), &lr, DT_SINGLELINE | DT_VCENTER | DT_CENTER);
+ DrawText(hdc, wd->date_buff, (int)_tcslen(wd->date_buff), &lr, DT_SINGLELINE | DT_VCENTER | DT_CENTER);
SelectObject(hdc, oldFont);
}
@@ -104,10 +104,10 @@ INT_PTR CALLBACK DlgProcDisplay(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, &other_st, 0, wd->date_buff, 128);
if(IsIconic(hwndDlg)) {
- char buff[255 + 32];
- strcpy(buff, wd->nick_buff);
- strcat(buff, " - ");
- strcat(buff, wd->time_buff);
+ TCHAR buff[255 + 32];
+ _tcscpy(buff, wd->nick_buff);
+ _tcscat(buff, _T(" - "));
+ _tcscat(buff, wd->time_buff);
SetWindowText(hwndDlg, buff);
} else
SetWindowText(hwndDlg, wd->nick_buff);
@@ -159,9 +159,9 @@ int show_time(HANDLE hContact) { wd->tzi.StandardDate = timezone_list[wd->timezone_list_index].TZI.StandardDate;
DBVARIANT dbv;
- if(!DBGetContactSetting(wd->hContact, PROTO, "Nick", &dbv)) {
- strncpy(wd->nick_buff, dbv.pszVal, 255);
- SetWindowText(hwnd, dbv.pszVal);
+ if(!DBGetContactSettingTString(wd->hContact, PROTO, "Nick", &dbv)) {
+ _tcsncpy(wd->nick_buff, dbv.ptszVal, 255);
+ SetWindowText(hwnd, dbv.ptszVal);
DBFreeVariant(&dbv);
}
@@ -188,7 +188,7 @@ void time_windows_cleanup() { while ( hContact != NULL )
{
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (proto && lstrcmp( PROTO, proto) == 0) {
+ if (proto && strcmp( PROTO, proto) == 0) {
if((hwnd = (HWND)DBGetContactSettingDword(hContact, PROTO, "WindowHandle", 0)) != 0) {
DestroyWindow(hwnd);
DBWriteContactSettingByte(hContact, PROTO, "WindowWasOpen", 1);
@@ -208,7 +208,7 @@ void time_windows_init() { while ( hContact != NULL )
{
char* proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (proto && lstrcmp( PROTO, proto) == 0)
+ if (proto && strcmp( PROTO, proto) == 0)
{
if (DBGetContactSettingByte(hContact, PROTO, "WindowWasOpen", 0) != 0)
{
@@ -217,17 +217,17 @@ void time_windows_init() { }
DBVARIANT dbv;
- if (!DBGetContactSetting(hContact, PROTO, "TZName", &dbv))
+ if (!DBGetContactSettingTString(hContact, PROTO, "TZName", &dbv))
{
int list_index = DBGetContactSettingDword(hContact, PROTO, "TimezoneListIndex", -1);
if (list_index < 0 || list_index >= timezone_list.getCount())
list_index = 0;
- if (strcmp(timezone_list[list_index].tcName, dbv.pszVal))
+ if (_tcscmp(timezone_list[list_index].tcName, dbv.ptszVal))
{
for (int j = 0; j < timezone_list.getCount(); ++j)
{
- if (!strcmp(timezone_list[j].tcName, dbv.pszVal))
+ if (!_tcscmp(timezone_list[j].tcName, dbv.ptszVal))
{
list_index = j;
break;
diff --git a/worldtime_protocol/timezone.cpp b/worldtime_protocol/timezone.cpp index 41a84c0..5839229 100644 --- a/worldtime_protocol/timezone.cpp +++ b/worldtime_protocol/timezone.cpp @@ -12,7 +12,7 @@ bool build_timezone_list() { HKEY HKlmtz;
HKEY KKtz;
DWORD dwIndex = 0;
- CHAR tcName[MAX_SIZE];
+ TCHAR tcName[MAX_SIZE];
DWORD dwcbName = MAX_SIZE;
DWORD dwcbValue;
DWORD dwcbSTD;
@@ -34,21 +34,21 @@ bool build_timezone_list() { return false;
}
- strncpy(Temp.tcName, tcName, MAX_SIZE);
+ _tcsncpy(Temp.tcName, tcName, MAX_SIZE);
dwcbValue = MAX_SIZE;
- RegQueryValueEx(KKtz,"Display",NULL,NULL,(BYTE*)Temp.tcDisp,&dwcbValue);
+ RegQueryValueEx(KKtz, _T("Display"), NULL, NULL, (LPBYTE)Temp.tcDisp, &dwcbValue);
dwcbDLT = MAX_SIZE;
- RegQueryValueEx(KKtz,"Dlt",NULL,NULL,(BYTE*)Temp.tcDLT,&dwcbDLT);
+ RegQueryValueEx(KKtz, _T("Dlt"), NULL, NULL, (LPBYTE)Temp.tcDLT, &dwcbDLT);
dwcbSTD = MAX_SIZE;
- RegQueryValueEx(KKtz,"Std",NULL,NULL,(BYTE*)Temp.tcSTD,&dwcbSTD);
+ RegQueryValueEx(KKtz, _T("Std"), NULL, NULL, (LPBYTE)Temp.tcSTD, &dwcbSTD);
dwcbValue = MAX_SIZE;
- RegQueryValueEx(KKtz,"MapID",NULL,NULL,(BYTE*)Temp.MapID,&dwcbValue);
+ RegQueryValueEx(KKtz, _T("MapID"), NULL, NULL, (LPBYTE)Temp.MapID, &dwcbValue);
if(!win9x) {
dwcbValue = sizeof(DWORD);
- RegQueryValueEx(KKtz,"Index",NULL,NULL,(BYTE*)&Temp.Index,&dwcbValue);
+ RegQueryValueEx(KKtz, _T("Index"), NULL, NULL, (LPBYTE)&Temp.Index, &dwcbValue);
}
dwcbValue = sizeof(Temp.TZI);
- RegQueryValueEx(KKtz,"TZI",NULL,NULL,(BYTE*)&Temp.TZI,&dwcbValue);
+ RegQueryValueEx(KKtz, _T("TZI"), NULL, NULL, (LPBYTE)&Temp.TZI, &dwcbValue);
RegCloseKey(KKtz);
diff --git a/worldtime_protocol/timezone.h b/worldtime_protocol/timezone.h index ba0f878..328abed 100644 --- a/worldtime_protocol/timezone.h +++ b/worldtime_protocol/timezone.h @@ -1,9 +1,9 @@ #ifndef _TIMEZONE_H
#define _TIMEZONE_H
-#define TZREG "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones"
-#define TZREG_9X "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Time Zones"
-//#define TZREG2 "SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation"
+#define TZREG _T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones")
+#define TZREG_9X _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Time Zones")
+//#define TZREG2 _T("SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation")
#define MAX_SIZE 512
#include "common.h"
diff --git a/worldtime_protocol/timezone_list.cpp b/worldtime_protocol/timezone_list.cpp index 2e28bc1..6f1b5a8 100644 --- a/worldtime_protocol/timezone_list.cpp +++ b/worldtime_protocol/timezone_list.cpp @@ -13,11 +13,11 @@ void load_listbox_items() { listbox_items.destroy();
while ( hContact != NULL ) {
proto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM )hContact,0 );
- if ( proto && !lstrcmp( PROTO, proto)) {
+ if ( proto && !strcmp( PROTO, proto)) {
pa.hContact = hContact;
- if(!DBGetContactSetting(pa.hContact, PROTO, "TZName", &dbv)) {
+ if(!DBGetContactSettingTString(pa.hContact, PROTO, "TZName", &dbv)) {
for (int j = 0; j < timezone_list.getCount(); ++j) {
- if(!strcmp(timezone_list[j].tcName, dbv.pszVal)) {
+ if(!_tcscmp(timezone_list[j].tcName, dbv.ptszVal)) {
pa.timezone_list_index = timezone_list[j].list_index;
break;
}
@@ -25,8 +25,8 @@ void load_listbox_items() { DBFreeVariant(&dbv);
} else
pa.timezone_list_index = DBGetContactSettingDword(pa.hContact, PROTO, "TimezoneListIndex", -1);
- if(!DBGetContactSetting(pa.hContact, PROTO, "Nick", &dbv)) {
- strncpy(pa.pszText, dbv.pszVal, MAX_NAME_LENGTH);
+ if(!DBGetContactSettingTString(pa.hContact, PROTO, "Nick", &dbv)) {
+ _tcsncpy(pa.pszText, dbv.ptszVal, MAX_NAME_LENGTH);
DBFreeVariant(&dbv);
}
@@ -50,10 +50,10 @@ void save_listbox_items() { CallService(MS_IGNORE_IGNORE, (WPARAM)listbox_items[i].hContact, (WPARAM)IGNOREEVENT_USERONLINE);
}
- DBWriteContactSettingString(listbox_items[i].hContact, PROTO, "Nick", listbox_items[i].pszText);
+ DBWriteContactSettingTString(listbox_items[i].hContact, PROTO, "Nick", listbox_items[i].pszText);
DBWriteContactSettingDword(listbox_items[i].hContact, PROTO, "TimezoneListIndex", listbox_items[i].timezone_list_index);
DBWriteContactSettingWord(listbox_items[i].hContact, PROTO, "Status", ID_STATUS_ONLINE);
- DBWriteContactSettingString(listbox_items[i].hContact, PROTO, "TZName", timezone_list[listbox_items[i].timezone_list_index].tcName);
+ DBWriteContactSettingTString(listbox_items[i].hContact, PROTO, "TZName", timezone_list[listbox_items[i].timezone_list_index].tcName);
}
DBWriteContactSettingWord(0, PROTO, "DataVersion", 1);
@@ -63,7 +63,7 @@ void save_listbox_items() { bool found;
while ( hContact != NULL ) {
proto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM )hContact,0 );
- if ( proto && !lstrcmp( PROTO, proto)) {
+ if ( proto && !strcmp( PROTO, proto)) {
found = false;
for(int i = 0; i < listbox_items.getCount(); i++) {
if(listbox_items[i].hContact == hContact) {
diff --git a/worldtime_protocol/timezone_list.h b/worldtime_protocol/timezone_list.h index e497e2b..2208f98 100644 --- a/worldtime_protocol/timezone_list.h +++ b/worldtime_protocol/timezone_list.h @@ -9,7 +9,7 @@ typedef struct tagLISTITEM {
int cbSize;
HANDLE hContact;
- char pszText[MAX_NAME_LENGTH];
+ TCHAR pszText[MAX_NAME_LENGTH];
int timezone_list_index;
} LISTITEM;
diff --git a/worldtime_protocol/worldtimeproto.cpp b/worldtime_protocol/worldtimeproto.cpp index 2c06f53..6645112 100644 --- a/worldtime_protocol/worldtimeproto.cpp +++ b/worldtime_protocol/worldtimeproto.cpp @@ -207,15 +207,15 @@ INT_PTR EditContact(WPARAM wParam, LPARAM lParam) { pa.hContact = (HANDLE)wParam;
pa.timezone_list_index = DBGetContactSettingDword(pa.hContact, PROTO, "TimezoneListIndex", -1);
- if(!DBGetContactSetting(pa.hContact, PROTO, "Nick", &dbv)) {
- strncpy(pa.pszText, dbv.pszVal, MAX_NAME_LENGTH);
+ if(!DBGetContactSettingTString(pa.hContact, PROTO, "Nick", &dbv)) {
+ _tcsncpy(pa.pszText, dbv.ptszVal, MAX_NAME_LENGTH);
DBFreeVariant(&dbv);
}
add_edit_item = pa;
if(DialogBox(hInst, MAKEINTRESOURCE(IDD_DIALOG2), hwndList, DlgProcOptsEdit) == IDOK) {
pa = add_edit_item;
- DBWriteContactSettingString(pa.hContact, PROTO, "Nick", pa.pszText);
+ DBWriteContactSettingTString(pa.hContact, PROTO, "Nick", pa.pszText);
DBWriteContactSettingDword(pa.hContact, PROTO, "TimezoneListIndex", pa.timezone_list_index);
DBWriteContactSettingWord(pa.hContact, PROTO, "Status", ID_STATUS_ONLINE);
return 0;
@@ -246,13 +246,11 @@ void DestroyServiceFunctions() { void replaceStr(TCHAR* str, size_t nchar, TCHAR* rstr)
{
- size_t lenr = _tcslen(rstr) * sizeof(TCHAR);
- size_t lenNew = (_tcslen(str) - nchar + 1) * sizeof(TCHAR) + lenr;
+ size_t lenr = _tcslen(rstr);
+ size_t lenNew = (_tcslen(str) - nchar + 1) + lenr;
- nchar *= sizeof(TCHAR);
-
- memmove(str + lenr, str + nchar, lenNew - lenr);
- memcpy(str, rstr, lenr);
+ memmove(str + lenr, str + nchar, (lenNew - lenr) * sizeof(TCHAR));
+ memcpy(str, rstr, lenr * sizeof(TCHAR));
}
@@ -274,11 +272,11 @@ VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { HANDLE hContact = ( HANDLE )CallService( MS_DB_CONTACT_FINDFIRST, 0, 0 );
while ( hContact != NULL ) {
proto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM )hContact,0 );
- if ( proto && !lstrcmp( PROTO, proto)) {
+ if ( proto && !strcmp( PROTO, proto)) {
pa.hContact = hContact;
pa.timezone_list_index = DBGetContactSettingDword(pa.hContact, PROTO, "TimezoneListIndex", -1);
- if(!DBGetContactSetting(pa.hContact, PROTO, "Nick", &dbv)) {
- strncpy(pa.pszText, dbv.pszVal, MAX_NAME_LENGTH);
+ if(!DBGetContactSettingTString(pa.hContact, PROTO, "Nick", &dbv)) {
+ _tcsncpy(pa.pszText, dbv.ptszVal, MAX_NAME_LENGTH);
DBFreeVariant(&dbv);
}
status = DBGetContactSettingWord(pa.hContact, PROTO, "Status", ID_STATUS_ONLINE);
@@ -303,17 +301,17 @@ VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { TCHAR buf[1024];
TCHAR* pos;
_tcscpy(buf, clist_format_string);
- pos = strstr(buf, "%n");
+ pos = _tcsstr(buf, _T("%n"));
if (pos != NULL)
replaceStr(pos, 2, pa.pszText);
- pos = strstr(buf, "%t");
+ pos = _tcsstr(buf, _T("%t"));
if (pos != NULL)
replaceStr(pos, 2, time_buf);
- pos = strstr(buf, "%d");
+ pos = _tcsstr(buf, _T("%d"));
if (pos != NULL)
replaceStr(pos, 2, date_buf);
- pos = strstr(buf, "%o");
+ pos = _tcsstr(buf, _T("%o"));
if(pos != NULL)
{
int other_offset, offset;
@@ -338,7 +336,7 @@ VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { } else
other_offset = tzi.Bias;
- char temp_buf[8];
+ TCHAR temp_buf[8];
unsigned char icq_offset = (unsigned char)((other_offset / 60) * 2) + (other_offset % 60) / 30;
@@ -349,34 +347,34 @@ VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) { //if(offset > 12 * 60) offset -= 24 * 60;
//if(offset < -12 * 60) offset += 24 * 60;
- mir_snprintf(temp_buf, sizeof(temp_buf), "%+g", offset/60.0);
+ mir_sntprintf(temp_buf, SIZEOF(temp_buf), _T("%+g"), offset/60.0);
replaceStr(pos, 2, temp_buf);
}
- if(!DBGetContactSetting(pa.hContact, "CList", "MyHandle", &dbv)) {
+ if(!DBGetContactSettingTString(pa.hContact, "CList", "MyHandle", &dbv)) {
// only write if times are different
- if(strcmp(dbv.pszVal, buf))
- DBWriteContactSettingString(pa.hContact, "CList", "MyHandle", buf);
+ if(_tcscmp(dbv.ptszVal, buf))
+ DBWriteContactSettingTString(pa.hContact, "CList", "MyHandle", buf);
DBFreeVariant(&dbv);
} else
- DBWriteContactSettingString(pa.hContact, "CList", "MyHandle", buf);
+ DBWriteContactSettingTString(pa.hContact, "CList", "MyHandle", buf);
- if(!DBGetContactSetting(pa.hContact, PROTO, "FirstName", &dbv)) {
+ if(!DBGetContactSettingTString(pa.hContact, PROTO, "FirstName", &dbv)) {
// only write if times are different
- if(strcmp(dbv.pszVal, time_buf))
- DBWriteContactSettingString(pa.hContact, PROTO, "FirstName", time_buf);
+ if(_tcscmp(dbv.ptszVal, time_buf))
+ DBWriteContactSettingTString(pa.hContact, PROTO, "FirstName", time_buf);
DBFreeVariant(&dbv);
} else
- DBWriteContactSettingString(pa.hContact, PROTO, "FirstName", time_buf);
+ DBWriteContactSettingTString(pa.hContact, PROTO, "FirstName", time_buf);
if(set_format) {
- if(!DBGetContactSetting(pa.hContact, PROTO, "LastName", &dbv)) {
+ if(!DBGetContactSettingTString(pa.hContact, PROTO, "LastName", &dbv)) {
// only write if times are different
- if(strcmp(dbv.pszVal, date_buf))
- DBWriteContactSettingString(pa.hContact, PROTO, "LastName", date_buf);
+ if(_tcscmp(dbv.ptszVal, date_buf))
+ DBWriteContactSettingTString(pa.hContact, PROTO, "LastName", date_buf);
DBFreeVariant(&dbv);
} else
- DBWriteContactSettingString(pa.hContact, PROTO, "LastName", date_buf);
+ DBWriteContactSettingTString(pa.hContact, PROTO, "LastName", date_buf);
} else
DBDeleteContactSetting(pa.hContact, PROTO, "LastName");
@@ -436,7 +434,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) { while ( hContact != NULL )
{
proto = ( char* )CallService( MS_PROTO_GETCONTACTBASEPROTO, ( WPARAM )hContact,0 );
- if ( proto && !lstrcmp( PROTO, proto)) {
+ if ( proto && !strcmp( PROTO, proto)) {
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, (WPARAM)IGNOREEVENT_USERONLINE);
DBDeleteContactSetting(hContact, PROTO, "WindowHandle");
}
diff --git a/worldtime_protocol/worldtimeproto_9.vcproj b/worldtime_protocol/worldtimeproto_9.vcproj index f22d470..b4bc0fd 100644 --- a/worldtime_protocol/worldtimeproto_9.vcproj +++ b/worldtime_protocol/worldtimeproto_9.vcproj @@ -116,7 +116,7 @@ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
+ CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
@@ -304,7 +304,7 @@ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
+ CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
|