15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


Persistent Properties in OCX

Bruce R. Cochran -- brc@colossus.Storz.Com
Wednesday, July 31, 1996

Environment: VC++ 4.2 under Windows 95

I am having a problem making a property persistent. I thought that I could 
create a persistent property by adding the appropriate PX_ call in the DoPropExchange
function and invoking SetModifiedFlag() in the property set function. I have shown below
the basic code to do this, but when the SetMyProp routine is called the new value is never serialized. 
I have traced through this program and DoPropExchange only seems to get called when the control
is loaded and never again. Am I misinformed on the property persistence ?? or is something wrong, any
help would be greatly appreciated.


class CMyCtrl : public COleControl
{
	DECLARE_DYNCREATE(CMyCtrl)
	short m_MyProp; 



John & Annette Elsbree -- elsbree@msn.com
Monday, August 05, 1996

Bruce -

You have not indicated what kind of container you're using your control in. 
Some containers will save the modified state of controls, others will not. 
Generally, containers that are "design-time" containers, such as the VC++ 
dialog editor, or the form editor in Visual Basic, will save modified controls 
when they've been changed. However, "run-time" containers, such as an MFC 
application or a running Visual Basic application, will NOT save modified 
controls (where would they save this data?).

John

----------
From: 	owner-mfc-l@netcom.com on behalf of Bruce Cochran
Sent: 	Wednesday, July 31, 1996 1:30 PM
To: 	'mfc-l@netcom.com'
Subject: 	Persistent Properties in OCX

Environment: VC++ 4.2 under Windows 95

I am having a problem making a property persistent. I thought that I could 
create a persistent property by adding the appropriate PX_ call in the 
DoPropExchange
function and invoking SetModifiedFlag() in the property set function. I have 
shown below
the basic code to do this, but when the SetMyProp routine is called the new 
value is never serialized. 
I have traced through this program and DoPropExchange only seems to get called 
when the control
is loaded and never again. Am I misinformed on the property persistence ?? or 
is something wrong, any
help would be greatly appreciated.


class CMyCtrl : public COleControl
{
	DECLARE_DYNCREATE(CMyCtrl)
	short m_MyProp; 





| Вернуться в корень Архива |