OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How to get dispatch of inserted Ole object

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Radco
Newbie
Newbie


Joined: 13 Nov 2008
Posts: 1

PostPosted: Thu Nov 13, 2008 1:18 am    Post subject: How to get dispatch of inserted Ole object Reply with quote

I inserted OLE object to Calc:

CComPtr<IDispatch> Sheet(...); //get active sheet
AutoWrap(DISPATCH_METHOD, &ResultVar, Sheet, L"getDrawPage", 0);
CComPtr<IDispatch> Shapes(ResultVar.pdispVal); //get shapes
CComVariant Param(L"com.sun.star.drawing.OLE2Shape");
AutoWrap(DISPATCH_METHOD, &ResultVar, m_Document, L"createInstance", 1, Param); //create OLE2Shape
...
//set position
//set size
...
Param = Ole2Shape;
AutoWrap(DISPATCH_METHOD, ResultVar, Shapes, L"add", 1, Param); //add OLE2Shape to shapes
CLSID Clsid;
CLSIDFromProgID(L"GrafyX.GrafyFrmX", &Clsid); //obtain CLSID of my ActiveX object
...
Param = Clsid;
Ole2Shape.PutPropertyByName(L"CLSID", &Param); //initialize

Everything pass. How I get IDispatch of my ActiveX object (GrafyFrmX) inserted in Calc? (I need it to insert data to object)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group