Sunday, February 05, 2012
What's error?
Last Post 11 Jan 2010 09:10 AM by Julian Guillo. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
assassinUser is Offline
New Member
New Member
Posts:94

--
06 Jan 2010 10:30 AM  

Hi, Jason, I want to change the variable in variable table by program with C++, but I find a question, program as following,

    pDis=pPartDoc->Variables;

    hr=pDis->QueryInterface(&pVars);

    pDis->Release();
//    hr=pVars->Edit("a","120"); /// It's OK!
    _variant_t v;
    v="a";
    hr=pVars->Item("a")->QueryInterface(&pVar); ///hr=NOINTERFACE

 

The same function in another program, the last hr's value is S_OK!

 

Could you help me?

 

Thanks!

Julian GuilloUser is Offline
Guru
Basic Member
Basic Member
Posts:125

--
11 Jan 2010 09:10 AM  
Hi,
I don't know about C++ but i think it could be the old problem:
In the variable table you can find "Variable" objects AND "Dimension" objects, so if you find the object with the "Query" method, you have to declare the variable that receives the object as type "Object".
If the variable is type "Variable" you will not get Dimensions and viceversa.
In your case i think i would try revising the declaration of "pVar" if i could understand your example.
You are not authorized to post a reply.

Active Forums 4.2
Copyright © 2011 JasonNewell.NET