Click here to Skip to main content
15,908,115 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: type safe issue Pin
CPallini11-Feb-08 10:39
mveCPallini11-Feb-08 10:39 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 16:18
Rajkumar R11-Feb-08 16:18 
GeneralRe: type safe issue Pin
Matthew Faithfull11-Feb-08 6:04
Matthew Faithfull11-Feb-08 6:04 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 16:29
Rajkumar R11-Feb-08 16:29 
GeneralRe: type safe issue Pin
George_George12-Feb-08 2:21
George_George12-Feb-08 2:21 
GeneralRe: type safe issue Pin
Rajkumar R12-Feb-08 2:44
Rajkumar R12-Feb-08 2:44 
GeneralRe: type safe issue Pin
George_George12-Feb-08 2:57
George_George12-Feb-08 2:57 
GeneralRe: type safe issue Pin
Matthew Faithfull12-Feb-08 2:27
Matthew Faithfull12-Feb-08 2:27 
This wrapper does not improve type safety at all. Let us say that p is declared as IMySpecialInterface*. How exactly is the external runtime that overwrites the value of p supposed to know whether it is 'allowed' to put a ISomePublicObject* in there or not. It cannot know, it does not check and all this is done at runtime anyway so there is no way to type constrain an addrees that is overwritten by an external process at runtime, during compilation.
Declaring p as a different type will not change the type that is pointed to after the call, ever, it simply disguises the fact that you cannot know what p is pointing to after the call except for the gaurentees that COM gives you.
When using the COM runtime you have the type safety gaurentess that the COM runtime gives you or you have none, you cannot fix this with C++ mechanics.

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

GeneralRe: type safe issue Pin
Rajkumar R12-Feb-08 2:43
Rajkumar R12-Feb-08 2:43 
GeneralRe: type safe issue Pin
Matthew Faithfull12-Feb-08 2:55
Matthew Faithfull12-Feb-08 2:55 
GeneralRe: type safe issue Pin
George_George12-Feb-08 3:08
George_George12-Feb-08 3:08 
GeneralRe: type safe issue Pin
Matthew Faithfull12-Feb-08 3:32
Matthew Faithfull12-Feb-08 3:32 
GeneralRe: type safe issue Pin
George_George12-Feb-08 18:00
George_George12-Feb-08 18:00 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 5:06
Rajkumar R11-Feb-08 5:06 
GeneralRe: type safe issue Pin
George_George12-Feb-08 2:08
George_George12-Feb-08 2:08 
GeneralRe: type safe issue Pin
George_George12-Feb-08 1:22
George_George12-Feb-08 1:22 
GeneralRe: type safe issue Pin
Rajkumar R12-Feb-08 1:45
Rajkumar R12-Feb-08 1:45 
GeneralRe: type safe issue Pin
George_George12-Feb-08 1:52
George_George12-Feb-08 1:52 
GeneralRe: type safe issue Pin
Rajkumar R12-Feb-08 2:58
Rajkumar R12-Feb-08 2:58 
GeneralRe: type safe issue Pin
George_George12-Feb-08 3:09
George_George12-Feb-08 3:09 
GeneralRe: type safe issue Pin
George_George12-Feb-08 1:20
George_George12-Feb-08 1:20 
GeneralRe: type safe issue Pin
Matthew Faithfull12-Feb-08 2:18
Matthew Faithfull12-Feb-08 2:18 
GeneralRe: type safe issue Pin
George_George12-Feb-08 2:23
George_George12-Feb-08 2:23 
QuestionHow to make a control transparent in a dialog Pin
swarup10-Feb-08 22:03
swarup10-Feb-08 22:03 
AnswerRe: How to make a control transparent in a dialog Pin
Hamid_RT10-Feb-08 22:13
Hamid_RT10-Feb-08 22:13 

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.