Click here to Skip to main content
16,008,719 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralListView problem Pin
Steve L.12-Aug-02 14:07
Steve L.12-Aug-02 14:07 
GeneralRe: ListView problem Pin
Shog912-Aug-02 14:24
sitebuilderShog912-Aug-02 14:24 
GeneralRe: ListView problem Pin
Steve L.12-Aug-02 14:45
Steve L.12-Aug-02 14:45 
GeneralCFileDialog title Pin
ns12-Aug-02 13:21
ns12-Aug-02 13:21 
GeneralRe: CFileDialog title Pin
Ravi Bhavnani12-Aug-02 13:48
professionalRavi Bhavnani12-Aug-02 13:48 
GeneralWorker Thread... Pin
fdmanana12-Aug-02 12:35
fdmanana12-Aug-02 12:35 
GeneralRe: Worker Thread... Pin
JT Anderson13-Aug-02 7:38
JT Anderson13-Aug-02 7:38 
Generalto parse a simple string Pin
ns12-Aug-02 12:25
ns12-Aug-02 12:25 
I have a variable (its a char*) which has the following stuff in it:

char * xyz = "C:\dir1\dir2\file.mdb, location1"

I want to put this into two variables which look like

char * dbName = "C:\\dir1\\dir2\\file.mdb"

and

char* location = "location1"

Should I first convert xyz into a CString, then do stuff to it (what exactly? to get two subCStrings then convert them back into char *s?

So I'm looking at Find, Right and Left:

If I had CString str = "abcd,efg"

Then int pos = str.Find(",") should give me zero based location 4.

then

CString leftstr = str.Left(pos) will be "abcd"

and

CString rightstr = str.Right(str.GetLength() - pos-1) will be "efg"

I cant test this out right now, so I'm wondering if this will work. Do you see any flaws with my numbers or thought process? and to do the '\' to '\\' I'd use Replace....

Thanks,
nsUnsure | :~
GeneralRe: to parse a simple string Pin
Eddie Velasquez12-Aug-02 12:37
Eddie Velasquez12-Aug-02 12:37 
GeneralRe: to parse a simple string Pin
Ravi Bhavnani12-Aug-02 12:48
professionalRavi Bhavnani12-Aug-02 12:48 
GeneralThanks, .... Pin
ns12-Aug-02 13:03
ns12-Aug-02 13:03 
Questiontry, catch - is this legal? Pin
ns12-Aug-02 11:30
ns12-Aug-02 11:30 
AnswerRe: try, catch - is this legal? Pin
Chris Losinger12-Aug-02 11:36
professionalChris Losinger12-Aug-02 11:36 
GeneralRe: try, catch - is this legal? Pin
ns12-Aug-02 12:00
ns12-Aug-02 12:00 
GeneralRe: try, catch - is this legal? Pin
Christian Graus12-Aug-02 12:53
protectorChristian Graus12-Aug-02 12:53 
GeneralRe: try, catch - is this legal? Pin
Chris Losinger12-Aug-02 13:06
professionalChris Losinger12-Aug-02 13:06 
GeneralMigrating from VC6 to VC7 Issue Pin
Sydney Liles12-Aug-02 10:56
Sydney Liles12-Aug-02 10:56 
GeneralRe: Migrating from VC6 to VC7 Issue Pin
Shog912-Aug-02 12:09
sitebuilderShog912-Aug-02 12:09 
GeneralRe: Migrating from VC6 to VC7 Issue Pin
Sydney Liles12-Aug-02 12:20
Sydney Liles12-Aug-02 12:20 
GeneralRe: Migrating from VC6 to VC7 Issue Pin
Shog912-Aug-02 13:36
sitebuilderShog912-Aug-02 13:36 
GeneralRe: Migrating from VC6 to VC7 Issue Pin
Sydney Liles13-Aug-02 8:23
Sydney Liles13-Aug-02 8:23 
GeneralI'm stumped Pin
Nick Parker12-Aug-02 9:33
protectorNick Parker12-Aug-02 9:33 
GeneralRe: I'm stumped Pin
Ranjan Banerji12-Aug-02 9:39
Ranjan Banerji12-Aug-02 9:39 
GeneralRe: I'm stumped Pin
Nick Parker12-Aug-02 11:51
protectorNick Parker12-Aug-02 11:51 
GeneralRe: I'm stumped Pin
Space Ace12-Aug-02 10:02
Space Ace12-Aug-02 10:02 

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.