Click here to Skip to main content
15,902,198 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Audio Device Enumeration Pin
Rajkumar R10-Feb-08 23:10
Rajkumar R10-Feb-08 23:10 
GeneralRe: Audio Device Enumeration [modified] Pin
Rajkumar R10-Feb-08 23:19
Rajkumar R10-Feb-08 23:19 
Generaltype safe issue Pin
George_George10-Feb-08 22:47
George_George10-Feb-08 22:47 
GeneralRe: type safe issue [modified] Pin
Rajkumar R11-Feb-08 0:06
Rajkumar R11-Feb-08 0:06 
GeneralRe: type safe issue Pin
Matthew Faithfull11-Feb-08 0:10
Matthew Faithfull11-Feb-08 0:10 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 0:39
Rajkumar R11-Feb-08 0:39 
GeneralRe: type safe issue Pin
Matthew Faithfull11-Feb-08 0:59
Matthew Faithfull11-Feb-08 0:59 
GeneralRe: type safe issue [modified] Pin
Rajkumar R11-Feb-08 1:33
Rajkumar R11-Feb-08 1:33 
May be ur not getting me or I explain not clearly.

Type safety is not what u have meant, please refer [^]

say, int function(int *) expects int * while int function (void *) is undefined.

that is why strongly typed languages uses type system

definition of void in msdn
The void type describes an empty set of values. No variable of type void can be specified — it is used primarily to declare functions that return no values or to declare generic pointers to untyped or arbitrarily typed data.

CoCreateInstance return pointer to IUnknown, but it is not type restricted to store in pointer to int. Actually to tackle this situation using C++ template is what george discussing with the use of IComPtr.


Matthew Faithfull wrote:
hich will be overwritten by the CoCreateInstance call with an IUnknown pointer


not necessary. a pointer to object derived from IUnknown not pointer to IUnknown.
both r different. as a side note COM is binary standard it is not restricting to derive from IUnknown.

Question is not related to what CoCreateInstance returns, but is it type safe,
IX *pIX = NULL;
CoCreateInstance(..., IID_IY, &pIX); // not type safe, programming mistake not caught by typesafe compiler.
here trying to get interface to IX, but IID for IY, if COM interface for IY exist then expected IX interface is not valid.

modified on Monday, February 11, 2008 8:51 AM

GeneralRe: type safe issue Pin
Matthew Faithfull11-Feb-08 2:53
Matthew Faithfull11-Feb-08 2:53 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 3:17
Rajkumar R11-Feb-08 3:17 
GeneralRe: type safe issue Pin
CPallini11-Feb-08 3:20
mveCPallini11-Feb-08 3:20 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 3:26
Rajkumar R11-Feb-08 3:26 
GeneralRe: type safe issue Pin
CPallini11-Feb-08 3:41
mveCPallini11-Feb-08 3:41 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 3:54
Rajkumar R11-Feb-08 3:54 
QuestionRe: type safe issue Pin
CPallini11-Feb-08 4:10
mveCPallini11-Feb-08 4:10 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 4:12
Rajkumar R11-Feb-08 4:12 
QuestionRe: type safe issue Pin
CPallini11-Feb-08 5:11
mveCPallini11-Feb-08 5:11 
GeneralRe: type safe issue [modified] Pin
Matthew Faithfull11-Feb-08 3:28
Matthew Faithfull11-Feb-08 3:28 
GeneralRe: type safe issue [modified] Pin
Rajkumar R11-Feb-08 3:52
Rajkumar R11-Feb-08 3:52 
GeneralRe: type safe issue Pin
Matthew Faithfull11-Feb-08 4:29
Matthew Faithfull11-Feb-08 4:29 
GeneralRe: type safe issue [modified] Pin
Rajkumar R11-Feb-08 4:34
Rajkumar R11-Feb-08 4:34 
GeneralRe: type safe issue Pin
Matthew Faithfull11-Feb-08 4:54
Matthew Faithfull11-Feb-08 4:54 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 5:04
Rajkumar R11-Feb-08 5:04 
GeneralRe: type safe issue Pin
Matthew Faithfull11-Feb-08 5:20
Matthew Faithfull11-Feb-08 5:20 
GeneralRe: type safe issue Pin
Rajkumar R11-Feb-08 5:25
Rajkumar R11-Feb-08 5:25 

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.