Link to home
Start Free TrialLog in
Avatar of engllf
engllf

asked on

CString::Left

How do i solve this problem?
I need to extract the leftmost 5 characters of a CString.

CString szSvPath("D:\\AB\\CDE\\F.EXE") ;
CString szPath ;
szPath = szSvPath.Left[5] ;

error C2109: subscript requires array or pointer type
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class CString (CString::*)(int)const ' (or there is no acceptable conversion)
Error executing cl.exe.
Creating browse info file...

ASKER CERTIFIED SOLUTION
Avatar of nebeker
nebeker

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of engllf
engllf

ASKER

How careless of me.  I should have notice that.
Thanx.