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

C / C++ / MFC

 
GeneralBitmaps again... Pin
Dennis L22-Feb-03 22:46
Dennis L22-Feb-03 22:46 
GeneralRe: Bitmaps again... Pin
Joaquín M López Muñoz23-Feb-03 5:10
Joaquín M López Muñoz23-Feb-03 5:10 
GeneralRe: Bitmaps again... Pin
MAAK23-Feb-03 9:44
MAAK23-Feb-03 9:44 
GeneralSplitting a CString Pin
ROK_RShadow22-Feb-03 21:38
ROK_RShadow22-Feb-03 21:38 
GeneralRe: Splitting a CString Pin
Pavel Klocek23-Feb-03 1:25
Pavel Klocek23-Feb-03 1:25 
GeneralRe: Splitting a CString Pin
Big Art23-Feb-03 10:48
Big Art23-Feb-03 10:48 
GeneralRe: Splitting a CString Pin
ROK_RShadow23-Feb-03 12:36
ROK_RShadow23-Feb-03 12:36 
GeneralRe: Splitting a CString Pin
Big Art24-Feb-03 5:21
Big Art24-Feb-03 5:21 
Here you are:

CString sPath(_T("c:\\data\\moredata\\evenmoredata\\datafile.dat"));

int nPos1 = sPath.ReverseFind('\\');
int nPos2 = sPath.ReverseFind('.');

if(nPos1 > -1 && nPos2 > -1)
{
CString sFile = sPath.Mid(nPos1+1, nPos2 - nPos1 -1);
AfxMessageBox(sFile);

}


-----------------
The ReverseFind fn just searches the string starting from the end toward the beginning and stops when it encounters the character it is looking for. The position it reports is referenced from the beginning of the string.

Art
GeneralNeed help on some weird errors Pin
Abin22-Feb-03 20:23
Abin22-Feb-03 20:23 
GeneralRe: Need help on some weird errors Pin
Michael Dunn22-Feb-03 20:35
sitebuilderMichael Dunn22-Feb-03 20:35 
Generalstoring and accessing file names from FindNextFile() Pin
kiken22-Feb-03 18:11
kiken22-Feb-03 18:11 
GeneralRe: storing and accessing file names from FindNextFile() Pin
valikac22-Feb-03 18:19
valikac22-Feb-03 18:19 
GeneralRe: storing and accessing file names from FindNextFile() Pin
Michael Dunn22-Feb-03 18:24
sitebuilderMichael Dunn22-Feb-03 18:24 
GeneralToolbars Pin
boon kian22-Feb-03 17:14
boon kian22-Feb-03 17:14 
GeneralRe: Toolbars Pin
ROK_RShadow22-Feb-03 17:41
ROK_RShadow22-Feb-03 17:41 
GeneralRe: Toolbars Pin
boon kian22-Feb-03 18:43
boon kian22-Feb-03 18:43 
GeneralRe: Toolbars Pin
ROK_RShadow22-Feb-03 19:12
ROK_RShadow22-Feb-03 19:12 
GeneralCommand Routing Pin
ROK_RShadow22-Feb-03 16:21
ROK_RShadow22-Feb-03 16:21 
GeneralRe: Command Routing Pin
Taka Muraoka23-Feb-03 0:43
Taka Muraoka23-Feb-03 0:43 
GeneralHelp me please,Urgent!! Pin
ucc80122-Feb-03 15:25
ucc80122-Feb-03 15:25 
GeneralRe: Help me please,Urgent!! Pin
Roger Allen24-Feb-03 1:20
Roger Allen24-Feb-03 1:20 
GeneralWin32 Wrapper Class - Problem with window creation Pin
Skute22-Feb-03 14:01
Skute22-Feb-03 14:01 
GeneralRe: Win32 Wrapper Class - Problem with window creation Pin
Jambolo22-Feb-03 20:25
Jambolo22-Feb-03 20:25 
GeneralOnwer Draw spin control only Pin
Wolfram Steinke22-Feb-03 12:53
Wolfram Steinke22-Feb-03 12:53 
GeneralProblem with Developer Studio (VC++ ver 4.0) Pin
Still learning how to code22-Feb-03 11:43
Still learning how to code22-Feb-03 11:43 

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.