Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
hi,

I try to develop application using TAPI3 interface, but I got some problem when run C++ code in c#.net:
ITStreamControl * pStreamControl;
HRESULT hr = pBasicCall->QueryInterface(
        IID_ITStreamControl,
        (void **) &pStreamControl
        );

I used this : 
ITStreamControl pstream_control;
                                    
pstream_control=(ITStreamControl) call_control;


but I got this message 'Specified cast is not valid.'

Regards,
Andy
Posted
Updated 3-May-11 1:03am
v2
Comments
Ankit Rajput 3-May-11 7:29am    
What is the type of call_control?
Manfred Rudolf Bihy 3-May-11 11:43am    
That exactly should point to the solution!
eyeshield21 3-May-11 12:47pm    
hi ankit,

pBasicCall in C++ and call_control in C# is ITBasicCallControl type

regards,
andy
Manfred Rudolf Bihy 3-May-11 11:45am    
Would you care to ask a question?
Hint: Questions are indicated by having a question mark (?) at the end of the sentence.
eyeshield21 3-May-11 12:50pm    
hi manfred,

my question is how to convert the c++ code:
<pre>
ITStreamControl * pStreamControl;
HRESULT hr = pBasicCall->QueryInterface(
IID_ITStreamControl,
(void **) &pStreamControl
);
</pre>
into C# code.


regards,
andy

1 solution

 
Share this answer
 
Comments
eyeshield21 5-May-11 22:40pm    
Thanks kim Togo.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900