Solved

property bag

Posted on 2001-08-09
10
334 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Determine Range to Select 5 35
message box in access 4 34
Multiple image collision 13 46
Passing a Text Box name to a Sub 6 25
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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

743 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

11 Experts available now in Live!

Get 1:1 Help Now