Solved

property bag

Posted on 2001-08-09
10
348 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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
 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

752 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