Click here to Skip to main content
15,888,340 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: dll project does not produce library (.lib) Pin
AssemblySoft25-Nov-04 6:35
AssemblySoft25-Nov-04 6:35 
GeneralRe: dll project does not produce library (.lib) Pin
John R. Shaw25-Nov-04 7:04
John R. Shaw25-Nov-04 7:04 
GeneralIcons in a treelist Pin
Anonymous25-Nov-04 6:19
Anonymous25-Nov-04 6:19 
GeneralRe: Icons in a treelist Pin
Joel Lucsy25-Nov-04 7:26
Joel Lucsy25-Nov-04 7:26 
QuestionSomebody has been in my situation? Pin
doctorpi25-Nov-04 4:16
doctorpi25-Nov-04 4:16 
AnswerRe: Somebody has been in my situation? Pin
Maximilien25-Nov-04 5:43
Maximilien25-Nov-04 5:43 
GeneralC++ Question Pin
dmxdmxdmx0525-Nov-04 4:05
dmxdmxdmx0525-Nov-04 4:05 
GeneralRe: C++ Question Pin
toxcct25-Nov-04 5:37
toxcct25-Nov-04 5:37 
for the example, i use a CString :
<font color=#0000FF>char</font> ExtractMiddleNode(<font color=#0000FF>const</font> CString& str) {
    <font color=#0000FF>return</font> str[(<font color=#0000FF>int</font>)(str.GetLength() / 2)];
}

i explain.
GetLength() gives the length of str.
GetLength()/2 so gives the middle of the string.
if the string contain 2n characters (where n is an integer), so, GetLength()/2 gives an integer, that is the position of the middle character.
if the string contains 2n+1 characters (with n still an integer), GetLength()/2 gives an integer+0.5. that's why a truncated the result with the (int) cast.

understand ? Smile | :)


TOXCCT >>> GEII power
[VisualCalc]

GeneralRe: C++ Question Pin
John R. Shaw25-Nov-04 6:37
John R. Shaw25-Nov-04 6:37 
GeneralRe: C++ Question Pin
toxcct25-Nov-04 6:41
toxcct25-Nov-04 6:41 
GeneralRe: C++ Question Pin
dmxdmxdmx0525-Nov-04 7:28
dmxdmxdmx0525-Nov-04 7:28 
GeneralRe: C++ Question Pin
John R. Shaw25-Nov-04 5:43
John R. Shaw25-Nov-04 5:43 
GeneralRe: C++ Question Pin
dmxdmxdmx0525-Nov-04 7:29
dmxdmxdmx0525-Nov-04 7:29 
GeneralRe: C++ Question Pin
John R. Shaw25-Nov-04 7:44
John R. Shaw25-Nov-04 7:44 
GeneralRe: C++ Question Pin
dmxdmxdmx0525-Nov-04 9:18
dmxdmxdmx0525-Nov-04 9:18 
GeneralRe: C++ Question Pin
John R. Shaw25-Nov-04 9:39
John R. Shaw25-Nov-04 9:39 
GeneralMFC Application Installation Problem Pin
Pradeep Samji25-Nov-04 3:50
Pradeep Samji25-Nov-04 3:50 
GeneralRe: MFC Application Installation Problem Pin
Antony M Kancidrowski25-Nov-04 4:08
Antony M Kancidrowski25-Nov-04 4:08 
GeneralRe: MFC Application Installation Problem Pin
david_gilmour25-Nov-04 17:18
david_gilmour25-Nov-04 17:18 
GeneralHelp needed in MFC Pin
Ibana25-Nov-04 3:01
Ibana25-Nov-04 3:01 
GeneralRe: Help needed in MFC Pin
Niklas L25-Nov-04 3:13
Niklas L25-Nov-04 3:13 
GeneralRe: Help needed in MFC Pin
Joaquín M López Muñoz25-Nov-04 3:21
Joaquín M López Muñoz25-Nov-04 3:21 
GeneralRe: Help needed in MFC Pin
Ibana25-Nov-04 7:23
Ibana25-Nov-04 7:23 
GeneralRe: Help needed in MFC Pin
Joaquín M López Muñoz25-Nov-04 7:31
Joaquín M López Muñoz25-Nov-04 7:31 
GeneralTimer with 1ms(accurate) resolution Pin
ManishSaha25-Nov-04 2:46
ManishSaha25-Nov-04 2:46 

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.