Solved

property bag

Posted on 2001-08-09
10
338 Views
Last Modified: 2013-11-23
I have an ocx called OCX1.
When the acivex loads(executes) I like to get a value from property bag(Sessionid).
When OCX Terminates, I like to place a value -1.
-1 tells me that everything was okay when the user log out.
How can it be done using property bag or......

Thanks
Nesifa
0
Comment
Question by:nesifa
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 5

Expert Comment

by:rkot2000
ID: 6369550
i think you need to save this data to a file or registry.
0
 

Author Comment

by:nesifa
ID: 6369557
I see applications that you can change some of the poperties of design time. Next time you login, changes has taken place.
Let say I have a label with caption label1.
I want to save some information on label caption, so next time he/she logs in I grab the left over value.
Thanks.
nesifa!
0
 
LVL 5

Expert Comment

by:rkot2000
ID: 6369571
0
 
LVL 5

Accepted Solution

by:
rkot2000 earned 10 total points
ID: 6369579
create a new mdi project using vb project wizard and check code on mdi_load mdi_unload

Private Sub MDIForm_Unload(Cancel As Integer)
  If Me.WindowState <> vbMinimized Then
    SaveSetting App.Title, "Settings", "MainLeft", Me.Left
    SaveSetting App.Title, "Settings", "MainTop", Me.Top
    SaveSetting App.Title, "Settings", "MainWidth", Me.Width
    SaveSetting App.Title, "Settings", "MainHeight", Me.Height
  End If
End Sub


Private Sub MDIForm_Load()
  Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
  Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
  Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500)
  Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
End Sub

0
 

Expert Comment

by:capkirkie
ID: 6369598
PropBag.WriteProperty("propertyname",value[,defaultvalue])
PropBag.ReadProperty("propertyname"[,defaultvalue])

Reads and write's from/to property bag. The deafaultvalue is optional, in the writeproperty it ensure no unnescecary memory is used. When the written property is the default property, nothing is written to memory. The default value of the readproperty should be set to the same value. These properties should also be the same you used designing your ocx. You can use the read- and write- property events to implement all this. I hope this will help you.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:rkot2000
ID: 6369607
capkirkie - can you use this to preserve data between vb applications. start application read old data, set new data, stop application, start application and read new data?
0
 

Expert Comment

by:capkirkie
ID: 6369625
No just for saving the properties a programmer changes in design time in your ocx. But I guess you knew that too.
0
 

Author Comment

by:nesifa
ID: 6372672
Thanks
0
 

Author Comment

by:nesifa
ID: 6372673
Thanks
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6697177
If this proposed answer has helped you, please accept it, grade it and close this question.  If it did not, reject it and add comments as to your progress and what else is needed.  If no action is taken here by next week, we'll need to decide this outcome.  Expert input always welcome as well.

Thanks,
Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Making delphi communicate with a c# service 16 88
control image tags in a string ? 12 110
VB6 - Convert HH:MM into Decimal 8 51
Excel Automation VBA 19 25
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now