Click here to Skip to main content
15,914,452 members
Home / Discussions / COM
   

COM

 
Question_variant_t Question Pin
Gupta Suraj7-Dec-06 22:48
Gupta Suraj7-Dec-06 22:48 
GeneralRe: _variant_t Question Pin
prasad_som7-Dec-06 23:02
prasad_som7-Dec-06 23:02 
GeneralRe: _variant_t Question Pin
Gupta Suraj7-Dec-06 23:26
Gupta Suraj7-Dec-06 23:26 
AnswerRe: _variant_t Question Pin
prasad_som8-Dec-06 1:49
prasad_som8-Dec-06 1:49 
GeneralRe: _variant_t Question Pin
Gupta Suraj8-Dec-06 3:26
Gupta Suraj8-Dec-06 3:26 
GeneralRe: _variant_t Question Pin
Ed Gadziemski8-Dec-06 18:29
professionalEd Gadziemski8-Dec-06 18:29 
GeneralRe: _variant_t Question Pin
Gupta Suraj10-Dec-06 17:44
Gupta Suraj10-Dec-06 17:44 
GeneralRe: _variant_t Question Pin
prasad_som10-Dec-06 21:29
prasad_som10-Dec-06 21:29 
Though, you had a solution to your problem;

Gupta Suraj wrote:
bool operator of _com_ptr template class is called.


Which operator bool you are talking about ? In fact, it should return you custom interface type.
Its implementated like this,
operator T*()   {
    return p;

So I feel, it should return interface pointer.
Can you show how you have declared this interface ?
Gupta Suraj wrote:
We don't have a overloaded constructor of _variant_t class which takes smart pointer as its parameter.


No, CComPtr, will be called for operator T*. Which returns appropriate interface pointer.
i.e. consider this declaration,
CComPtr<IMyInterface> pMy;
_variant_t f(pMy);

Here,in second statement pMy->Operator T* will be get called first. Which returns IMyInterface*.
So, it will set for VT_IDISPATCH automatically.
You dont even need to cast it.


GeneralRe: _variant_t Question Pin
Gupta Suraj11-Dec-06 18:28
Gupta Suraj11-Dec-06 18:28 
AnswerRe: _variant_t Question Pin
prasad_som11-Dec-06 19:22
prasad_som11-Dec-06 19:22 
GeneralRe: _variant_t Question Pin
Gupta Suraj11-Dec-06 19:36
Gupta Suraj11-Dec-06 19:36 
GeneralRe: _variant_t Question Pin
prasad_som11-Dec-06 19:51
prasad_som11-Dec-06 19:51 
QuestionAutomation, cross thread problem Pin
anderslundsgard6-Dec-06 21:36
anderslundsgard6-Dec-06 21:36 
AnswerRe: Automation, cross thread problem Pin
«_Superman_»6-Dec-06 22:50
professional«_Superman_»6-Dec-06 22:50 
AnswerRe: Automation, cross thread problem Pin
Roger Stoltz6-Dec-06 22:50
Roger Stoltz6-Dec-06 22:50 
AnswerRe: Automation, cross thread problem Pin
lafleon7-Dec-06 10:25
lafleon7-Dec-06 10:25 
GeneralRe: Automation, cross thread problem Pin
anderslundsgard7-Dec-06 2:40
anderslundsgard7-Dec-06 2:40 
GeneralRe: Automation, cross thread problem Pin
Roger Stoltz7-Dec-06 3:22
Roger Stoltz7-Dec-06 3:22 
GeneralRe: Automation, cross thread problem Pin
anderslundsgard7-Dec-06 4:01
anderslundsgard7-Dec-06 4:01 
GeneralRe: Automation, cross thread problem Pin
Roger Stoltz7-Dec-06 4:50
Roger Stoltz7-Dec-06 4:50 
QuestionCocreateInstance fails Pin
Shailesh Ha5-Dec-06 19:04
Shailesh Ha5-Dec-06 19:04 
AnswerRe: CocreateInstance fails Pin
prasad_som5-Dec-06 20:22
prasad_som5-Dec-06 20:22 
GeneralRe: CocreateInstance fails Pin
Shailesh Ha5-Dec-06 21:55
Shailesh Ha5-Dec-06 21:55 
GeneralRe: CocreateInstance fails Pin
prasad_som5-Dec-06 22:15
prasad_som5-Dec-06 22:15 
GeneralRe: CocreateInstance fails Pin
Shailesh Ha5-Dec-06 22:31
Shailesh Ha5-Dec-06 22:31 

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.