Click here to Skip to main content
15,901,666 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
zarraza9-Oct-07 11:25
zarraza9-Oct-07 11:25 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
Iain Clarke, Warrior Programmer9-Oct-07 11:30
Iain Clarke, Warrior Programmer9-Oct-07 11:30 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
zarraza9-Oct-07 11:50
zarraza9-Oct-07 11:50 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
Roger Broomfield9-Oct-07 15:29
Roger Broomfield9-Oct-07 15:29 
GeneralRe: How to get pointer to client area in CDialog in SDI app?? Pin
zarraza10-Oct-07 11:41
zarraza10-Oct-07 11:41 
Questionvc++code for designing a scientific calculator Pin
AvishekBanerjee9-Oct-07 5:24
AvishekBanerjee9-Oct-07 5:24 
AnswerRe: vc++code for designing a scientific calculator Pin
David Crow9-Oct-07 5:42
David Crow9-Oct-07 5:42 
AnswerRe: vc++code for designing a scientific calculator Pin
toxcct9-Oct-07 5:44
toxcct9-Oct-07 5:44 
AnswerRe: vc++code for designing a scientific calculator Pin
Maximilien9-Oct-07 6:45
Maximilien9-Oct-07 6:45 
AnswerRe: vc++code for designing a scientific calculator Pin
Mark Salsbery9-Oct-07 8:12
Mark Salsbery9-Oct-07 8:12 
JokeRe: vc++code for designing a scientific calculator Pin
Hamid_RT9-Oct-07 9:44
Hamid_RT9-Oct-07 9:44 
AnswerRe: vc++code for designing a scientific calculator Pin
Hamid_RT9-Oct-07 9:54
Hamid_RT9-Oct-07 9:54 
GeneralRe: vc++code for designing a scientific calculator Pin
toxcct9-Oct-07 21:25
toxcct9-Oct-07 21:25 
GeneralRe: vc++code for designing a scientific calculator Pin
Hamid_RT10-Oct-07 7:06
Hamid_RT10-Oct-07 7:06 
QuestionTheory question about "void pBuffer" Pin
Nelek9-Oct-07 4:38
protectorNelek9-Oct-07 4:38 
AnswerRe: Theory question about "void pBuffer" Pin
led mike9-Oct-07 5:00
led mike9-Oct-07 5:00 
QuestionRe: Theory question about "void pBuffer" Pin
Nelek10-Oct-07 0:27
protectorNelek10-Oct-07 0:27 
AnswerRe: Theory question about "void pBuffer" Pin
led mike10-Oct-07 4:46
led mike10-Oct-07 4:46 
GeneralRe: Theory question about void pBuffer Pin
Nelek10-Oct-07 20:45
protectorNelek10-Oct-07 20:45 
GeneralRe: Theory question about void pBuffer Pin
led mike11-Oct-07 4:59
led mike11-Oct-07 4:59 
GeneralRe: Theory question about void pBuffer Pin
Nelek12-Oct-07 1:59
protectorNelek12-Oct-07 1:59 
AnswerRe: Theory question about "void pBuffer" Pin
Bram van Kampen9-Oct-07 15:31
Bram van Kampen9-Oct-07 15:31 
Don't quite understand the question, but there seems to be confusion about Arrays, Strings and CStrings. An Array is a continguous section of memory of which the compiler is aware of how it is organised.(Element Size, and Number of Elements). It is closely related to the Pointer to an Element Concept. However, whereas you can change a pointer point to a different location in memory, you cannot do this with a variable declared as an array name.[Error C2240] (The Compiler would soon loose track if you could do these things). A Pointer is more versatile than an array in this respect. However, the compiler still keeps track of the type(and hence size) of the object it points to. A pointer to void should be interpreted as a pointer to 'Nothing in Particular' It has only an address value, all other interresting titbits are ommitted. That means that the compiler cannot dereference a void pointer, it has insufficient information to do so. We use a Pointer to void as a generic pointer, which can be passed on by value, but which we must render usable as pointer by adding information, (i.e. Casting)
A String of characters is closely related to an array of characters, there is actually only one difference, when initialised with a literal text constant, the compiler adds automatically a terminating zero to a string. It would for instance not do that if you initialise an array of integers.
This brings us to a CString. Now, this is an entirely different kettle of fish. The items discussed above are essentially C-constructs, which can ofcourse be used in CPP. A CString is firmly a CPP Class, it is definitely NOT the same as a character array. The properties of a CString are not determined by the Compiler (as in Strings and Arrays) but are implemented as part of the Microsoft Standard Libraries. What makes it confusing for a novice is that aparently CStrings and Strings can often be used interchangably, and that the CString can be initialised to the value of a String. This is all due (and purposely designed to work this way) to the gymnastics carried out in the various methods of the CString class. As an example, A CString contains indeed a buffer containing the Null terminated string representing the value. The Cast Operator (LPCSTR) is written in such a way that it returns a pointer to this buffer. I Suggest that you experiment with the CString Class to get a feel for what I am about here. As for your own Array's, why not write your own dedicated class which keeps track of buffers and sizes, and which 'act' like arrays by using the various 'operator' overrides

LateNightsInNewry

GeneralRe: Theory question about "void pBuffer" Pin
Nelek9-Oct-07 22:14
protectorNelek9-Oct-07 22:14 
QuestionMCI -> set video position at a specific time Pin
sdancer759-Oct-07 4:36
sdancer759-Oct-07 4:36 
AnswerRe: MCI -> set video position at a specific time Pin
Hamid_RT9-Oct-07 9:46
Hamid_RT9-Oct-07 9: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.