Click here to Skip to main content
15,914,943 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralProblem when adding two wave files Pin
Member 95034310-Mar-04 3:26
Member 95034310-Mar-04 3:26 
Questionwhat does (CeditStr *) in (CeditStr *)Variable.funcition do?? Pin
BrockVnm10-Mar-04 3:20
BrockVnm10-Mar-04 3:20 
AnswerRe: what does (CeditStr *) in (CeditStr *)Variable.funcition do?? Pin
toxcct10-Mar-04 3:27
toxcct10-Mar-04 3:27 
AnswerRe: what does (CeditStr *) in (CeditStr *)Variable.funcition do?? Pin
David Crow10-Mar-04 3:28
David Crow10-Mar-04 3:28 
GeneralRe: what does (CeditStr *) in (CeditStr *)Variable.funcition do?? Pin
BrockVnm10-Mar-04 4:28
BrockVnm10-Mar-04 4:28 
GeneralRe: what does (CeditStr *) in (CeditStr *)Variable.funcition do?? Pin
David Crow10-Mar-04 4:43
David Crow10-Mar-04 4:43 
GeneralRe: what does (CeditStr *) in (CeditStr *)Variable.funcition do?? Pin
BrockVnm10-Mar-04 4:56
BrockVnm10-Mar-04 4:56 
GeneralRe: what does (CeditStr *) in (CeditStr *)Variable.funcition do?? Pin
David Crow10-Mar-04 5:15
David Crow10-Mar-04 5:15 
BrockVnm wrote:
So when would I use casting?

When an object needs to be coerced into acting like another type. Casting does not convert, is just represents.

BrockVnm wrote:
How would the code snippet be redundant?

The cast here is redundant since the array is holding CString* types and that's how we want to use it.
CArray< CString *, CString *> arr;
CString *p = (CString *) arr.GetAt(5);
The cast here is necessary because the array is holding CWnd* types, but we want to use one of them as a CEdit* type
CArray< CWnd *, CWnd *> arr;
CEdit *p = (CEdit *) arr.GetAt(5);
A simpler example might be:

double dRate = 1.997;
double d1 = (double) dRate; // not necessary
int nWhole = (int) dRate;   // necessary, since we only want to operate on the 'whole' part of the number



"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
GeneralRe: what does (CeditStr *) in (CeditStr *)Variable.funcition do?? Pin
Prakash Nadar10-Mar-04 6:27
Prakash Nadar10-Mar-04 6:27 
Generaltypedef struct &lt;-&gt; struct Pin
Konrad Windszus10-Mar-04 3:03
Konrad Windszus10-Mar-04 3:03 
GeneralRe: typedef struct &lt;-&gt; struct Pin
toxcct10-Mar-04 3:11
toxcct10-Mar-04 3:11 
GeneralRe: typedef struct &lt;-&gt; struct Pin
Robert A. T. Káldy11-Mar-04 1:44
Robert A. T. Káldy11-Mar-04 1:44 
GeneralProblem with popup menus Pin
amit sebiz10-Mar-04 1:34
amit sebiz10-Mar-04 1:34 
GeneralRe: Problem with popup menus Pin
Vahid Kazemi10-Mar-04 6:03
Vahid Kazemi10-Mar-04 6:03 
GeneralRe: Problem with popup menus Pin
amit sebiz10-Mar-04 17:36
amit sebiz10-Mar-04 17:36 
GeneralAcrobat Problem Pin
super-kingkong10-Mar-04 0:41
super-kingkong10-Mar-04 0:41 
GeneralRe: Acrobat Problem Pin
qcha0s12-Mar-04 3:58
qcha0s12-Mar-04 3:58 
QuestionHow to post a message to main frame of singledocument app from a static function? Pin
freehawk9-Mar-04 23:17
freehawk9-Mar-04 23:17 
AnswerRe: How to post a message to main frame of singledocument app from a static function? Pin
vikramlinux9-Mar-04 23:32
vikramlinux9-Mar-04 23:32 
AnswerRe: How to post a message to main frame of singledocument app from a static function? Pin
Prakash Nadar9-Mar-04 23:46
Prakash Nadar9-Mar-04 23:46 
AnswerRe: How to post a message to main frame of singledocument app from a static function? Pin
Robert A. T. Káldy9-Mar-04 23:56
Robert A. T. Káldy9-Mar-04 23:56 
GeneralRe: How to post a message to main frame of singledocument app from a static function? Pin
freehawk10-Mar-04 0:22
freehawk10-Mar-04 0:22 
GeneralRe: How to post a message to main frame of singledocument app from a static function? Pin
Robert A. T. Káldy10-Mar-04 0:27
Robert A. T. Káldy10-Mar-04 0:27 
GeneralRe: How to post a message to main frame of singledocument app from a static function? Pin
freehawk10-Mar-04 20:20
freehawk10-Mar-04 20:20 
Generalusing managed class in VC++ .Net Pin
Jain Mohit9-Mar-04 23:04
Jain Mohit9-Mar-04 23:04 

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.