Click here to Skip to main content
15,923,376 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCustom Vector Allocator Pin
miketra3-Jul-07 10:04
miketra3-Jul-07 10:04 
AnswerRe: Custom Vector Allocator Pin
Maximilien3-Jul-07 10:31
Maximilien3-Jul-07 10:31 
GeneralVector Function erase() Pin
miketra3-Jul-07 10:55
miketra3-Jul-07 10:55 
GeneralRe: Vector Function erase() Pin
Stephen Hewitt3-Jul-07 13:59
Stephen Hewitt3-Jul-07 13:59 
QuestionHow to prevent CMainFrame from restores???? Pin
SandipG 3-Jul-07 9:22
SandipG 3-Jul-07 9:22 
AnswerRe: How to prevent CMainFrame from restores???? Pin
MANISH RASTOGI3-Jul-07 18:46
MANISH RASTOGI3-Jul-07 18:46 
Questionruntime type casting Pin
wallbrick3-Jul-07 6:00
wallbrick3-Jul-07 6:00 
AnswerRe: runtime type casting Pin
Matthew Faithfull3-Jul-07 6:18
Matthew Faithfull3-Jul-07 6:18 
Strictly speaking you can't do what you've asked about in ordinary C++. Only using .NET reflection, but the chances are that the set of types is not really 'unknown' at compile time it's just that you don't want to have to write much or any new code when you change that set?
If that's true you have a chance. Consider using templates e.g.
<br />
template< typename Ti, typename To ><br />
Convert( Ti* pIn, To* pOut )<br />
{<br />
//Conversion code would go here but it's going to have to make<br />
//some assumptions about the types in order to work<br />
//which means it won't work with just anything :(<br />
}<br />


In the end you'll probably have to provide lots of type specific template overrides like

<br />
Convert( double* pIn, char* pOut )<br />
{<br />
//a call to printf may occur somewhere in here :omg:<br />
}<br />


which is not much better than where you started out.
If you've hit this problem and most of us have D'Oh! | :doh: then you probably need to go back and look at your design with a 'what is this really try to achieve' hat on Smile | :)


Nothing is exactly what it seems but everything with seems can be unpicked.

AnswerRe: runtime type casting Pin
led mike3-Jul-07 6:22
led mike3-Jul-07 6:22 
AnswerRe: runtime type casting Pin
Nuxser3-Jul-07 15:59
Nuxser3-Jul-07 15:59 
AnswerRe: runtime type casting Pin
Nuxser3-Jul-07 16:17
Nuxser3-Jul-07 16:17 
Questionget Distinguished Email id from GAL Pin
Ganesh_T3-Jul-07 5:47
Ganesh_T3-Jul-07 5:47 
QuestionThread syncronization Win32 Pin
Alex Cutovoi3-Jul-07 5:26
Alex Cutovoi3-Jul-07 5:26 
AnswerRe: Thread syncronization Win32 Pin
Matthew Faithfull3-Jul-07 6:08
Matthew Faithfull3-Jul-07 6:08 
AnswerRe: Thread syncronization Win32 Pin
led mike3-Jul-07 6:19
led mike3-Jul-07 6:19 
GeneralRe: Thread syncronization Win32 Pin
Alex Cutovoi3-Jul-07 6:46
Alex Cutovoi3-Jul-07 6:46 
GeneralRe: Thread syncronization Win32 Pin
led mike3-Jul-07 8:26
led mike3-Jul-07 8:26 
GeneralRe: Thread syncronization Win32 Pin
Alex Cutovoi5-Jul-07 6:53
Alex Cutovoi5-Jul-07 6:53 
GeneralRe: Thread syncronization Win32 Pin
led mike5-Jul-07 7:17
led mike5-Jul-07 7:17 
GeneralRe: Thread syncronization Win32 Pin
Alex Cutovoi5-Jul-07 11:29
Alex Cutovoi5-Jul-07 11:29 
QuestionGraphic control on CFormView Pin
kcselvaraj3-Jul-07 5:05
kcselvaraj3-Jul-07 5:05 
AnswerRe: Graphic control on CFormView Pin
Mark Salsbery3-Jul-07 8:10
Mark Salsbery3-Jul-07 8:10 
GeneralRe: Graphic control on CFormView [modified] Pin
kcselvaraj3-Jul-07 10:14
kcselvaraj3-Jul-07 10:14 
Questionerrors on linking for *.def file Options Pin
A7Zulu3-Jul-07 4:30
A7Zulu3-Jul-07 4:30 
AnswerRe: errors on linking for *.def file Options Pin
Iain Clarke, Warrior Programmer3-Jul-07 5:53
Iain Clarke, Warrior Programmer3-Jul-07 5:53 

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.