本文整理汇总了C++中LPCTSTR函数的典型用法代码示例。如果您正苦于以下问题:C++ LPCTSTR函数的具体用法?C++ LPCTSTR怎么用?C++ LPCTSTR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LPCTSTR函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _T
/*========================================================================
Name: 连接 SQL SERVER 数据库.
-----------------------------------------------------
Params: [dbsrc]: SQL SERVER 服务器名.
[dbname]: 默认的数据库名.
[user]: 用户名.
[pass]: 密码.
==========================================================================*/
BOOL CAdoConnection::ConnectSQLServer(CString dbsrc, CString dbname, CString user, CString pass, long lOptions)
{
CString strConnect = _T("Provider=SQLOLEDB.1; Data Source=") + dbsrc +
_T("; Initial Catalog=") + dbname +
_T("; User ID=") + user +
_T("; PWD=") + pass;
return Open(LPCTSTR(strConnect), lOptions);
}
示例2: if
LRESULT CClientDlg::OnWinListChanged( WPARAM wp, LPARAM lp )
{
list<WIN_INFO> info;
m_pClient->GetWindowList( info );
m_TextWinList1.ResetContent();
list<WIN_INFO>::iterator I = info.begin();
for( ; I != info.end(); I++ )
{
CString s1 = L"";
if( I->placement.showCmd == SW_SHOWMAXIMIZED )
{
s1 = L",Maximized";
}
else if( I->placement.showCmd == SW_SHOWMINIMIZED )
{
s1 = L",Minimized";
}
else if( I->placement.showCmd == SW_SHOWNORMAL )
{
s1 = L",Normal";
}
CString s;
s.Format( L"[%08X%s] - \"%s\" (%s)",
I->id, LPCTSTR(s1), I->title, I->classname );
#ifdef NoHideJava
if(NULL!= wcsstr(I->classname,L"SunAwtFrame"))
m_TextWinList1.AddItem(s,RGB(255, 0, 0), RGB(255, 255,255), I->id);
else
if(NULL!= wcsstr(I->classname,L"SunAwtDialog"))
m_TextWinList1.AddItem(s,RGB(255, 0, 0), RGB(255, 255,255), I->id);
else
#else
if(NULL!= wcsstr(I->classname,L"SunAwtFrame"))
continue;
else
if(NULL!= wcsstr(I->classname,L"SunAwtDialog"))
continue;
else
#endif
if(NULL!= wcsstr(I->classname,L"IEFrame"))
m_TextWinList1.AddItem(s,RGB(50, 100, 150), RGB(220, 220,220), I->id);
else
if(NULL!= wcsstr(I->classname,L"#"))
m_TextWinList1.AddItem(s,RGB(0, 0, 0), RGB(245, 245,16), I->id);
else
if(NULL!= wcsstr(I->classname,L"Desktop"))
m_TextWinList1.AddItem(s,RGB(0, 255, 0), RGB(0, 0,0), I->id);
else
m_TextWinList1.AddItem(s,RGB(255, 255, 255), RGB(0, 0,0), I->id);
}
m_TextWinList1.UpdateData(true);
Log( L"Received list of windows." );
return 0;
}
示例3: _T
/*========================================================================
Name: 连接 ACCESS 数据库.
-----------------------------------------------------
Params: [dbpath]: MDB 数据库file路径名.
[pass]: 访问密码.
===========================================================================*/
BOOL CDBAccess::ConnectAccess(CString dbpath, CString pass, long lOptions)
{
CString strConnect = _T("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=") + dbpath;
if (pass != _T(""))
{
strConnect += _T("Jet OLEDB:Database Password=") + pass + _T(";");
}
return Open(LPCTSTR(strConnect), lOptions);
}
示例4: DDX_Text
void CSystemConfigDlg::DoDataExchange(CDataExchange* pDX)
{
CString temp;
temp.Format("%d",PacketCount);
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT_PKT_COUNT, temp);
PacketCount = atoi( LPCTSTR(temp));
DDX_Check(pDX, IDC_CHECK_FORCE_PRECHECK, ForcePrecheck);
}
示例5: UpdateData
void CDirectoryPropPage::OnAddseparatorButton()
{
UpdateData(TRUE);
m_directoryeditstr += m_separatorstr;
m_directoryformatedit.ReplaceSel(LPCTSTR(m_separatorstr));
UpdateData(FALSE);
m_directoryformatedit.SetFocus();
}
示例6: fprintf
void CAppConfig::SaveHistory(CFile &f)
{
int i;
fprintf(f, "[Menu]\r\n");
for (i = 0; i < history_menu.GetSize(); ++i)
{
CString str = history_menu[i];
if (str[0] == 's') // bbs
{
int p = str.Find('\t');
if (p <= 0)
continue;
int p2 = str.Find('\t', p + 1);
if (p2 > 0) // 有進階設定檔
{
CString name = str.Mid(1, p - 1);
CString address = str.Mid(p, (p2 - p));
CString cfg = str.Mid(p2 + 1);
str = 's' + name;
str += address;
if (0 == strnicmp(cfg, ConfigPath, ConfigPath.GetLength()))
{
cfg = cfg.Mid(ConfigPath.GetLength());
cfg = cfg.Left(cfg.GetLength() - name.GetLength());
cfg.Replace(';', '\\');
cfg += name;
str += '\t';
str += cfg;
}
}
}
str += "\r\n";
f.Write(LPCTSTR(str), str.GetLength());
}
fprintf(f, "\r\n[DropDown]\r\n");
for (i = 0; i < history_dropdown.GetSize(); ++i)
fprintf(f, "%s\r\n", LPCTSTR(history_dropdown[i]));
fprintf(f, "\r\n[Typed]\r\n");
POSITION pos = history.GetHeadPosition();
for (; pos; history.GetNext(pos))
fprintf(f, "%s\r\n", LPCTSTR(history.GetAt(pos)));
}
示例7: GetStyle
//before Subclassing
void CMyHyperLink::PreSubclassWindow()
{
//Enable the Static to send the Window Messages To its parent
DWORD dwStyle = GetStyle();
SetWindowLong(GetSafeHwnd() ,GWL_STYLE ,dwStyle | SS_NOTIFY);
TCHAR szCurretText[MAX_PATH];
GetWindowText(szCurretText, MAX_PATH);
if ((szCurretText) == NULL){
SetWindowText(m_csLinkText.operator LPCTSTR());
}
LOGFONT sLogFont;
GetFont()->GetLogFont(&sLogFont);
//Set the Link UnderLined
sLogFont.lfUnderline = true;
//Set the Font to the Control
m_oTextFont.CreateFontIndirect(&sLogFont);
this->SetFont(&m_oTextFont, true);
//Adjust the window
//IsValidURL();
//Set the Cursor Hand
//WinHlp32.exe in windows folder ResourceID 106
//is a standard window HAND cursor
//courtesy www.codeguru.com
//you can use a custom Hand cursor resourse also
// i added that as a resourse in this project with
// ID - IDC_CURSOR_HAND
TCHAR szWindowsDir[MAX_PATH*2];
GetWindowsDirectory( szWindowsDir ,MAX_PATH*2);
_tcscat_s( szWindowsDir, MAX_PATH*2, _T( "\\Winhlp32.exe"));
HMODULE hModule = LoadLibrary(szWindowsDir);
if (hModule){
m_hHyperCursor = ::LoadCursor(hModule, MAKEINTRESOURCE(106));
}
this->SetCursor(m_hHyperCursor);
//free the module
if (hModule)
FreeLibrary(hModule);
CStatic::PreSubclassWindow();
this->SetCursor(m_hHyperCursor);
m_ToolTip.Create(this,TTS_ALWAYSTIP);
CRect oRect;
GetClientRect(&oRect);
m_ToolTip.AddTool(this, _T(""),oRect,1001);
m_ToolTip.ShowWindow(SW_HIDE);
}
示例8: while
void Dossier::OnClickedPhoto()
{
#ifndef BOB_DEMO_VER
if (LUF_FighterLF2BAND==Persons2::GetBandFromUID(uid) && RFullPanelDial::gameside == RFullPanelDial::SIDE_LW)
{
// launch fighters dialog
int i=0;
while (Node_Data.gruppe[i].squadron != SQ_ZERO)
{
if (Node_Data.gruppe[i].homeairfield == uid)
{
if (Node_Data.gruppe[i].AcType()<PT_LW_BOMBERS)
{
MainToolBar().OpenACDossier(Node_Data.gruppe[i].wadernum,
Node_Data.gruppe[i].gruppennum);
break;
}
}
i++;
}
}
else
{
if (ReconnRequired())
{
int packnum=Todays_Packages_NewPackage(uid,MMC.directives.lw.userprofiles[Directives::LW::RECON]);
if (packnum < 0)
RDialog::RMessageBox(IDS_WARNING, IDS_NOAIRCRAFTAVAIL,NULL,NULL,IDS_CONTINUE);
else
{
Todays_Packages[packnum].CalcRoutePositionsAndTime();
MainToolBar().OnClickedMissionfolder();
Todays_Packages.InvalidateRoute(&Todays_Packages[packnum],true,true);
}
}else
{
#ifndef NDEBUG
#define PLACEMENT CRect(0,0,512,384)
#else
#define PLACEMENT Place(POSN_CENTRE,POSN_CENTRE, 0, 0)
#endif
// #define PLACEMENT CRect(0,0,512,384)
UniqueID targID=UniqueID(uid);
CString tname=GetTargName(targID);
OverLay.SetTargName((char*)LPCTSTR(tname));
OverLay.loader_art=FIL_LOADING; //RJS 16Aug00
LogChild(0,MakeTopDialog(PLACEMENT,DialBox(OverLay.loader_art,new Rtestsh1(UniqueID(uid)),EDGES_NOSCROLLBARS)));
Rtestsh1::Start3d(Rtestsh1::S3D_DONEBACK);
}
}
#endif
}
示例9: FormatLongPath
void CBrowseForFolder::SetStatusText(const CString& strText) const
{
if (m_hwnd == NULL)
return;
CString oPathString = FormatLongPath(strText);
(void)SendMessage(m_hwnd, BFFM_SETSTATUSTEXT, NULL,
reinterpret_cast<long>(LPCTSTR(oPathString/*strText*/)));
}
示例10: _T
//open the URL by Windows ShellExecute()
bool CMyHyperLink::GoToLinkUrl(CString csLink)
{
HINSTANCE hInstance = (HINSTANCE)ShellExecute(NULL, _T("open"), csLink.operator LPCTSTR(), NULL, NULL, 2);
if ((UINT)hInstance < HINSTANCE_ERROR){
return false;
}else
return true;
}
示例11: Clean
CFilePath &CFilePath::operator = (LPCWSTR psString)
{
if (psString == msPath.operator LPCTSTR())
return *this;
msPath = psString;
Clean();
return *this;
}
示例12: Msg
void Msg(const char *msg, ...)
{
CString str;
va_list ap;
va_start(ap, msg);
str.FormatV(msg, ap);
va_end(ap);
GetBkEndUI()->DoMessageLine(str.operator LPCTSTR(), mmBlueTriangle);
}
示例13: guard
BOOL SeriesValuesDialog::OnInitDialog()
{
int i, j; CString T, T1;
CDialog::OnInitDialog();
void *x;
if((x=Series->GainAcsess(READ))!=NULL)
{
SeriesProtector guard(x); TSeriesArray& series(guard);
TChartSeries *graph=series[graph_num];
graph->GetInfo(strs); ListBox1.ResetContent(); for(i=0;i<strs.GetSize();i++) ListBox1.AddString(strs[i]);
LV_ITEM lvi; lvi.mask = LVIF_TEXT;
ListBox2.InsertColumn(0,"N",LVCFMT_CENTER,40,0);
ListBox2.InsertColumn(1,"X",LVCFMT_CENTER,50,1);
ListBox2.InsertColumn(2,"Y",LVCFMT_CENTER,60,2);
ListBox2.InsertColumn(3,"dY",LVCFMT_CENTER,60,3);
ListBox2.InsertColumn(4,"Type",LVCFMT_CENTER,60,3);
ListBox2.DeleteAllItems();
for(i=0;i<graph->GetSize();i++)
{
lvi.iItem = i; lvi.iSubItem = 0; T.Format("%d",i);
lvi.pszText = (char*)LPCTSTR(T);
ListBox2.InsertItem(&lvi);
graph->FormatElement(i,T);
int j_last=0, j_cur;
for(j=0;j<4;j++)
{
if((j_cur=T.Find(9,j_last))>0)
{
T1=T.Mid(j_last,j_cur-j_last);
ListBox2.SetItemText(i,j+1,(char*)LPCTSTR(T1));
j_last=j_cur+1;
}
}
}
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例14: UpdateData
void CDlg_H323::PopupCallingDlg()
{
if(!m_pCallingDlg)
m_pCallingDlg = new CCallingDlg;
if(m_pCallingDlg->GetSafeHwnd() == NULL)
m_pCallingDlg->Create(IDD_DLG_H323_CALLING,this);
m_pCallingDlg->ShowWindow(SW_SHOW);
UpdateData(TRUE);
m_pCallingDlg->ShowTip(LPCTSTR(m_strCalled));
}
示例15: _tcscpy
void CDlg_H323::SaveAdvSetup()
{
LPCTSTR strFile = ".\\H323.ini";
TCHAR strOpt[10];
LPCTSTR strApp = "网守设置";
if(m_bViaGK)
_tcscpy(strOpt,"TRUE");
else
_tcscpy(strOpt,"FALSE");
WritePrivateProfileString(strApp,"用网守呼叫",strOpt,strFile);
if(m_bViaGK)
WritePrivateProfileString(strApp,"网守",LPCTSTR(m_strGatekeeper),strFile);
if(m_bName)
_tcscpy(strOpt,"TRUE");
else
_tcscpy(strOpt,"FALSE");
WritePrivateProfileString(strApp,"用账户名登录",strOpt,strFile);
if(m_bName)
WritePrivateProfileString(strApp,"账户名",LPCTSTR(m_strName),strFile);
if(m_bNumber)
_tcscpy(strOpt,"TRUE");
else
_tcscpy(strOpt,"FALSE");
WritePrivateProfileString(strApp,"用电话号码登录",strOpt,strFile);
if(m_bNumber)
WritePrivateProfileString(strApp,"电话号码",LPCTSTR(m_strNumber),strFile);
if(m_bViaGW)
_tcscpy(strOpt,"TRUE");
else
_tcscpy(strOpt,"FALSE");
WritePrivateProfileString("网关设置","使用网关呼叫",strOpt,strFile);
if(m_bViaGW)
WritePrivateProfileString("网关设置","网关",LPCTSTR(m_strGateway),strFile);
}