Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2005

Tip: Looking for answers? Try searching our database.

Problem with ActiveX having another object as property!!!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ahmad Jalil Qarshi - 15 Mar 2005 16:28 GMT
hi!

i have an activeX control for MS Word. this activeX control has few
properties including an object as a property. i create this inner object
when the ActiveX control is inserted into Word. i.e in the InitNew function.
then i store some data into this Inner object's property. I press save
button but when i go to close the document, it again ask me "Do you want to
save Doc4". if i click yes. document is closed but when i check the contents
of Inner object in DocFile Viewer. its empty.
i don't know why it happens.

furthermore if i reopen a document which contains my ActiveX control. how
can i get  the data from inner Object's property.

i m using VC7.1 ,ATL COM

Ahmad Jalil Qarshi
Igor Tandetnik - 15 Mar 2005 16:38 GMT
> i have an activeX control for MS Word. this activeX control has few
> properties including an object as a property. i create this inner
[quoted text clipped - 5 lines]
> Viewer. its empty.
> i don't know why it happens.

Does your inner object implement a persistence interface such as
IPersistStreamInit? Do you list it in the control's property map?
Signature

With best wishes,
   Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925

Ahmad Jalil Qarshi - 16 Mar 2005 06:50 GMT
Thanks Igor.
yes i have implemented the persistance interface and also listed the inner
object as property in the COM_PROP_MAP of control. The thing which irritate
me is that if i insert some data into the property of the control and then
after saving the document when i go to close the Word y it again asks me "Do
you want to save Doc".

Ahmad Jalil Qarshi!

> > i have an activeX control for MS Word. this activeX control has few
> > properties including an object as a property. i create this inner
[quoted text clipped - 16 lines]
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
Igor Tandetnik - 21 Mar 2005 16:20 GMT
> yes i have implemented the persistance interface and also listed the
> inner object as property in the COM_PROP_MAP of control. The thing
> which irritate me is that if i insert some data into the property of
> the control and then after saving the document when i go to close the
> Word y it again asks me "Do you want to save Doc".

Looks like a problem with how IPersistStreamInit::IsDirty is
implemented. Check that after the control is saved for the first time,
IsDirty returns false both for the control itself and for the inner
object. If it does not, try to figure out why not.
Signature

With best wishes,
   Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925

Igor Tandetnik - 21 Mar 2005 16:23 GMT
> yes i have implemented the persistance interface and also listed the
> inner object as property in the COM_PROP_MAP of control. The thing
> which irritate me is that if i insert some data into the property of
> the control and then after saving the document when i go to close the
> Word y it again asks me "Do you want to save Doc".

Looks like a problem with how IPersistStreamInit::IsDirty is
implemented. Check that after the control is saved for the first time,
IsDirty returns false both for the control itself and for the inner
object. If it does not, try to figure out why not.
Signature

With best wishes,
   Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.