Click here to Skip to main content
15,917,456 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: std::string parsing Pin
Andrew Walker4-Nov-03 22:59
Andrew Walker4-Nov-03 22:59 
GeneralProblem in using FindFirstFile Pin
samhita4-Nov-03 18:02
samhita4-Nov-03 18:02 
GeneralRe: Problem in using FindFirstFile Pin
georgiek504-Nov-03 19:36
georgiek504-Nov-03 19:36 
GeneralHide/Show an Image Pin
Jackson Antony4-Nov-03 17:52
Jackson Antony4-Nov-03 17:52 
GeneralRe: Hide/Show an Image Pin
Joe Woodbury4-Nov-03 18:05
professionalJoe Woodbury4-Nov-03 18:05 
QuestionHow to print contents of CFrameWnd Pin
AJJU&GULLU4-Nov-03 17:51
sussAJJU&GULLU4-Nov-03 17:51 
GeneralC++ Question. Pin
WREY4-Nov-03 16:31
WREY4-Nov-03 16:31 
GeneralRe: C++ Question. Pin
Michael Dunn4-Nov-03 17:17
sitebuilderMichael Dunn4-Nov-03 17:17 
static_cast can do three things: 1) Invoke a built-in conversion or a class's conversion operator (which is technically redundant, but you can do it if you want to be explicit about it), 2) convert from an integral type to an enum type, and 3) do a possibly-unsafe downcast. Examples:
CString str = "foo";
LPCTSTR sz = static_cast<LPCTSTR>(str);  // #1
enum EFoo { bob, chris, mike } foo;
CButton* pBtn;
 
  foo = static_cast<EFoo>(2);  // #2
  pBtn = static_cast<CButton*>(GetDlgItem(IDOK)); // #3 - casts from a CWnd* to CButton*
Note with #3 that it's on your head to make sure the cast is actually safe. If it might not always be safe, use dynamic_cast instead.

reinterpret_cast does three different things: 1) Converts between a pointer type and an integral type, 2) between unrelated pointer types, 3) between void* and anything else. For ex:
SendMessage ( hwnd, UWM_CUSTOM_MESSAGE,
              reinterpret_cast<WPARAM>(szSomeString),
              reinterpret_cast<LPARAM>(&someObject) );


--Mike--
Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.
Pinky, are you pondering what I'm pondering?
I think so Brain, but how will we fit the hamster inside the accordion?

GeneralRe: C++ Question. Pin
Abhishek Srivastava4-Nov-03 17:35
Abhishek Srivastava4-Nov-03 17:35 
GeneralTree control property sheets Pin
dogan4-Nov-03 14:53
dogan4-Nov-03 14:53 
GeneralRe: Tree control property sheets Pin
[ Jûroehn ]4-Nov-03 16:15
[ Jûroehn ]4-Nov-03 16:15 
GeneralXP Themes and DLLs Pin
LukeV4-Nov-03 12:57
LukeV4-Nov-03 12:57 
QuestionHow to dynamically add objects to TTabControl?! Pin
[ Jûroehn ]4-Nov-03 12:43
[ Jûroehn ]4-Nov-03 12:43 
AnswerRe: How to dynamically add objects to TTabControl?! Pin
[ Jûroehn ]4-Nov-03 18:23
[ Jûroehn ]4-Nov-03 18:23 
GeneralHelp with file size.. Pin
Snyp4-Nov-03 12:38
Snyp4-Nov-03 12:38 
GeneralRe: Help with file size.. Pin
Joe Woodbury4-Nov-03 15:04
professionalJoe Woodbury4-Nov-03 15:04 
GeneralRe: Help with file size.. Pin
Snyp4-Nov-03 15:35
Snyp4-Nov-03 15:35 
GeneralRe: Help with file size.. Pin
Joe Woodbury4-Nov-03 17:35
professionalJoe Woodbury4-Nov-03 17:35 
GeneralWizard 97 problem Pin
Joe Woodbury4-Nov-03 12:33
professionalJoe Woodbury4-Nov-03 12:33 
GeneralRe: Wizard 97 problem Pin
Joe Woodbury4-Nov-03 12:50
professionalJoe Woodbury4-Nov-03 12:50 
GeneralThreads and sockets Pin
michael_cowan4-Nov-03 12:08
michael_cowan4-Nov-03 12:08 
GeneralRe: Threads and sockets Pin
valikac5-Nov-03 6:16
valikac5-Nov-03 6:16 
GeneralRe: Threads and sockets Pin
michael_cowan5-Nov-03 9:54
michael_cowan5-Nov-03 9:54 
GeneralGetClientRect...whats wrong?! Pin
Schniddel4-Nov-03 10:15
Schniddel4-Nov-03 10:15 
GeneralRe: GetClientRect...whats wrong?! Pin
JDasari6-Nov-03 7:54
JDasari6-Nov-03 7:54 

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.