Click here to Skip to main content
14,359,679 members

ATL / WTL / STL

 
GeneralRe: Unicode and codeproject article Pin
Richard MacCutchan28-Feb-15 23:15
protectorRichard MacCutchan28-Feb-15 23:15 
GeneralRe: Unicode and codeproject article Pin
Daniel Pfeffer28-Feb-15 23:19
professionalDaniel Pfeffer28-Feb-15 23:19 
GeneralRe: Unicode and codeproject article Pin
Richard MacCutchan1-Mar-15 2:42
protectorRichard MacCutchan1-Mar-15 2:42 
GeneralRe: Unicode and codeproject article Pin
bkelly131-Mar-15 6:39
memberbkelly131-Mar-15 6:39 
GeneralRe: Unicode and codeproject article Pin
Richard MacCutchan1-Mar-15 7:13
protectorRichard MacCutchan1-Mar-15 7:13 
GeneralRe: Unicode and codeproject article Pin
bkelly131-Mar-15 16:51
memberbkelly131-Mar-15 16:51 
GeneralRe: Unicode and codeproject article Pin
Theo Buys13-Apr-15 5:27
memberTheo Buys13-Apr-15 5:27 
QuestionCAsyncSocket::Connect( (LPCTSTR) m_address, m_port_number ) Pin
bkelly1324-Feb-15 11:50
memberbkelly1324-Feb-15 11:50 
Windows XP, soon to be Win 7, Visual Studio 2008, C++

The Connect function wants an LPCTSTR. m_address is declared as WCHAR. This compiles, but is it OK to use the code in the title or is it bad to do in the long term?

My searches for: convert WCHAR to LPCTSTR turn up some things, but nothing that appears to fit. I think my work firewall is filtering things out.

Edit: I have found that it is not ok to use in the short term. When used with SetDlgItemText to put text in a dialog, it does not work.

Starting with a WCHAR m_address[ 32 ];
and the need to call a function that needs LPCTSTR, such as Connect(...) or SetDlgItemText() that wants LPCTSTR, what can be done to m_address to build an LPCTSTR device.
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com



modified 24-Feb-15 17:20pm.

AnswerRe: CAsyncSocket::Connect( (LPCTSTR) m_address, m_port_number ) Pin
Richard MacCutchan24-Feb-15 23:30
protectorRichard MacCutchan24-Feb-15 23:30 
GeneralRe: CAsyncSocket::Connect( (LPCTSTR) m_address, m_port_number ) Pin
bkelly1325-Feb-15 5:32
memberbkelly1325-Feb-15 5:32 
GeneralRe: CAsyncSocket::Connect( (LPCTSTR) m_address, m_port_number ) Pin
Richard MacCutchan25-Feb-15 6:02
protectorRichard MacCutchan25-Feb-15 6:02 
GeneralRe: CAsyncSocket::Connect( (LPCTSTR) m_address, m_port_number ) Pin
bkelly1325-Feb-15 6:07
memberbkelly1325-Feb-15 6:07 
Questionis DLL appropriate Pin
bkelly1313-Dec-14 16:02
memberbkelly1313-Dec-14 16:02 
AnswerRe: is DLL appropriate Pin
Garth J Lancaster13-Dec-14 18:08
professionalGarth J Lancaster13-Dec-14 18:08 
AnswerRe: is DLL appropriate Pin
Richard MacCutchan13-Dec-14 22:24
protectorRichard MacCutchan13-Dec-14 22:24 
GeneralRe: is DLL appropriate Pin
bkelly1314-Dec-14 6:04
memberbkelly1314-Dec-14 6:04 
AnswerRe: is DLL appropriate Pin
Albert Holguin5-Jan-15 7:55
professionalAlbert Holguin5-Jan-15 7:55 
QuestionIssue with CHTMLEditView in CDHTMLDialog Pin
Member 1101896712-Dec-14 4:53
memberMember 1101896712-Dec-14 4:53 
SuggestionRe: Issue with CHTMLEditView in CDHTMLDialog Pin
Richard MacCutchan14-Dec-14 4:04
protectorRichard MacCutchan14-Dec-14 4:04 
GeneralRe: Issue with CHTMLEditView in CDHTMLDialog Pin
Member 110189678-Jan-15 0:22
memberMember 110189678-Jan-15 0:22 
GeneralRe: Issue with CHTMLEditView in CDHTMLDialog Pin
Richard MacCutchan8-Jan-15 1:07
protectorRichard MacCutchan8-Jan-15 1:07 
Questionusing friend Pin
bkelly139-Dec-14 8:29
memberbkelly139-Dec-14 8:29 
AnswerRe: using friend Pin
Richard MacCutchan10-Dec-14 6:22
protectorRichard MacCutchan10-Dec-14 6:22 
GeneralRe: using friend Pin
bkelly1311-Dec-14 11:24
memberbkelly1311-Dec-14 11:24 
GeneralRe: using friend Pin
Richard MacCutchan12-Dec-14 0:07
protectorRichard MacCutchan12-Dec-14 0:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.