Click here to Skip to main content
16,005,552 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalcombo box Pin
pnpfriend18-Jun-02 8:13
pnpfriend18-Jun-02 8:13 
GeneralRe: combo box Pin
Chris Losinger18-Jun-02 8:32
professionalChris Losinger18-Jun-02 8:32 
GeneralTransform and Lighting Caps for Graphics Card Pin
18-Jun-02 8:13
suss18-Jun-02 8:13 
GeneralRe: Transform and Lighting Caps for Graphics Card Pin
Mike Nordell18-Jun-02 14:22
Mike Nordell18-Jun-02 14:22 
QuestionCan I use CString in a Win32 application ? Pin
dlhson18-Jun-02 8:12
dlhson18-Jun-02 8:12 
AnswerRe: Can I use CString in a Win32 application ? Pin
Hans Ruck18-Jun-02 8:15
Hans Ruck18-Jun-02 8:15 
AnswerRe: Can I use CString in a Win32 application ? Pin
Hans Ruck18-Jun-02 8:18
Hans Ruck18-Jun-02 8:18 
AnswerRe: Can I use CString in a Win32 application ? Pin
Joaquín M López Muñoz18-Jun-02 8:32
Joaquín M López Muñoz18-Jun-02 8:32 
I'd suggest you consider it twice and try to stick with std::strings. As for the functions you need, it's simple to write them:
std::string mid(const std::string& str,std::string::size_type n,std::string::size_type m)
// extract chars from the n-th position up to the (m-1)-th, indexes are 0-based
{
  std::string::size_type count=m<=str.size()?m-n:std::string::npos;
  return str.substr(n,count);
}
 
std::string left(const std::string& str,std::string::size_type n)
// extracts n first leftmost chars
{
  std::string::size_type count=n<=str.size()?n:str.size();
  return str.substr(0,count);
}
 
std::string right(const std::string& str,std::string::size_type n)
// extracts n first rightmost chars
{
  std::string::size_type count=n<=str.size()?n:str.size();
  return str.substr(str.size()-count,count);
}


Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Can I use CString in a Win32 application ? Pin
Hans Ruck18-Jun-02 8:37
Hans Ruck18-Jun-02 8:37 
GeneralRe: Can I use CString in a Win32 application ? Pin
Joaquín M López Muñoz18-Jun-02 8:48
Joaquín M López Muñoz18-Jun-02 8:48 
GeneralRe: Can I use CString in a Win32 application ? Pin
Chris Losinger18-Jun-02 9:09
professionalChris Losinger18-Jun-02 9:09 
AnswerRe: Can I use CString in a Win32 application ? Pin
Christian Graus18-Jun-02 14:16
protectorChristian Graus18-Jun-02 14:16 
AnswerRe: Can I use CString in a Win32 application ? Pin
Michael Dunn18-Jun-02 15:34
sitebuilderMichael Dunn18-Jun-02 15:34 
QuestionHow can I use CString in a Win32 application ? Pin
dlhson18-Jun-02 8:04
dlhson18-Jun-02 8:04 
AnswerRe: How can I use CString in a Win32 application ? Pin
Chris Losinger18-Jun-02 8:11
professionalChris Losinger18-Jun-02 8:11 
AnswerRe: How can I use CString in a Win32 application ? Pin
Bill Wilson18-Jun-02 11:34
Bill Wilson18-Jun-02 11:34 
Questiontemplate ? Pin
Stan the man18-Jun-02 7:38
Stan the man18-Jun-02 7:38 
AnswerRe: template ? Pin
Le centriste18-Jun-02 7:46
Le centriste18-Jun-02 7:46 
GeneralRe: template ? Pin
18-Jun-02 11:37
suss18-Jun-02 11:37 
GeneralUsing IDOMDocument Pin
Hans Ruck18-Jun-02 7:23
Hans Ruck18-Jun-02 7:23 
GeneralRe: Using IDOMDocument Pin
Le centriste18-Jun-02 7:30
Le centriste18-Jun-02 7:30 
GeneralRe: Using IDOMDocument Pin
Hans Ruck18-Jun-02 7:34
Hans Ruck18-Jun-02 7:34 
GeneralRe: Using IDOMDocument Pin
Le centriste18-Jun-02 7:43
Le centriste18-Jun-02 7:43 
GeneralRe: Using IDOMDocument Pin
Hans Ruck18-Jun-02 8:04
Hans Ruck18-Jun-02 8:04 
GeneralRe: Using IDOMDocument Pin
Jim Crafton18-Jun-02 7:59
Jim Crafton18-Jun-02 7:59 

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.