Click here to Skip to main content
15,910,009 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 5:18
Rajkumar R11-Feb-08 5:18 
QuestionRe: type safe issue Pin
CPallini11-Feb-08 5:26
mveCPallini11-Feb-08 5:26 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 5:30
Rajkumar R11-Feb-08 5:30 
GeneralRe: type safe issue Pin
CPallini11-Feb-08 5:35
mveCPallini11-Feb-08 5:35 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 5:42
Rajkumar R11-Feb-08 5:42 
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 
How does calling the pointer you pass for overwriting a CThingy* stop the COM runtime which may be an implementation on a remote machine running under a different OS from overwriting the address you've passed with something that isn't a CThingy* ?

It doesn't and this happens at runtime so no compile time checks can prevent it.
Better to call it a void* to remind you that you don't know what it will be pointing at after the call, except the rules of COM say if the server end works it will safe to cast it to IUnknown* only.

Once you have IUnknown* the rules of COM say it's always safe to call QueryInterface and to believe the result you get.

If in either case the server lets you down the compiler can't help you. If you pretend that it can you won't understand why calling through your CThingy* after the call still crashes even though it looks type safe.

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

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 
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 

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.