How to save an object after exit - vb.net

So I'm currently working with VB.net and winforms and I need the have objects created from my classes saved so they are still there if I exit the program and open it again.
I also needed to make them dynamically so I was going to add them to a dictionary on creation and save that dictionary in the settings, but it seems that you can't save a dictionary in settings.
So how can I do this? Maybe something like save the creations in an excel sheet and recreate them on load each time, that might work but seems a tad inefficient, Thanks in advance, Ed.
(p.s. sorry if this makes no sense it's 1:30am in the morning here and I'm not really with it.)

So just putting this here in case anybody else has this problem, I took Plutonix's advice and looked into serialization and it sorted my problem, used this video: https://www.youtube.com/watch?v=oN_YHn3EVOs

Related

Realm database performance

I'm trying to use this database with react-native. First of all, i've found out that it can't retrieve plain objects - i have to retrieve all of the properties in the desired object tree recursively. And it takes about a second per object (~50 numeric props). Slow-ish!
Now, i've somehow imported ~9000 objects in it (each up to 1000 chars including titles). Looks like there is no easy ay to import it, at least it is not described in docs. Anyway, that's acceptable. But now i've found out that my database size (default.realm) is 3.49GB (!). The JSON file, which i was importing is only 6.5mb. I've opened default.realm with Realm Browser and it shows only those ~9000 objects, nothing else. Why so heavy?
Either, i don't understand something very fundamental about this database or it is complete garbage. I really hope i'm wrong. What am I doing wrong?
Please make sure you are not running in chrome debug mode. This is probably why things seem so slow. As far as the file size issue goes, it would be helpful if you posted your code to help figure out why that is happening.

Is there a standard process to save Excel File Formatting/Settings into an Object?

It could be cumbersome at times to maitain Excel Workbook's formatting/settings when heavy backend, front end work loads are done. At times (even frequently) workbooks were crashed. But I can't recall what the code or process was to avoid this happening due to the formatting. What I am clear is that before any data retrieval, processing took place in the workbook, I saved the Workbook's formatting/settings into an object. Once everything was completed, that object was called to restore. It was most probably one of the custom/user written classes.
That code was very handy when working with Workbooks to manage certain company standards/Logos/Colour Pallete/formatting/protection settings/code settings and so on.
So I just want to ask if anyone in the community have come across such process? I searched online and disappointing enough I am unable to find anything near - else I have really lost my wits on key-word search ;)
PS: This is not my home work or work. So please throw some light.
If you are talking about creating spreadsheets that conform to your branding standards, why don't you just create a template file:
http://office.microsoft.com/en-us/excel-help/save-a-workbook-or-worksheet-as-a-template-HA010218874.aspx

Multiple Layer-In-Folder Editing

So basically i have 10 copies of the same folder in 10 other seperate folders, and i want to edit the contents of the folders all at once.
All i want to do is move 2 layers to a different location for every single folder i have. How would i go about doing this?
Would anyone recommend batch or anything? and if so, it would be cool if someone could help and tell me how to do the required process too. Thank you.
Edit:
So for some reason my question is not going through so im going to assume i need more text or something so please dont read this as this is just random text im adding for no reason. im sorry.
if all the images and colors are same in the folders
then change one folder and duplicate in 10 times
as per your question i not fully understand
you have to provide some more information
:)
Use Smart Objects next time.
Now:
Convert folder in to Smart Object and dublicate in necessary location.
Edit Smart Object contents.

How do i create a routine that would constantly run in the background?

I am making a primitive database in Excel and need a routine to run in the background constantly. I will be able to fill in the actual actions it needs to do, but I don't know how to make something run independent of a key press or some sort of Macro. If someone can give me an example of code that runs independently which I can simply fill with contents, that would be much appreciated.
Try this http://www.ozgrid.com/Excel/run-macro-on-time.htm
I haven't worked with VBA for quite some time now, but you would have to create a thread in VBA, maybe by COM-Threading, but I am not too sure if Excel is threadsafe or if you even can use Threads of some kind in Excel. Another alternative would be a Timer. If it is not implemented in VBA and I don't remember it to be, you would have to create the Timer yourself and react to the Windows Message yourself, if you can do that in VBA.
All in all I think this uses case might be to big for an Excel VBA Macro. If I were you I would consider doing this in a different way.

Locked Classes with VBA/VB

I want to package my classes (in VBA or VB), but I want to put a lock on them before I do so. I want the computer to return a message similar to one in the Word file attached. Can anybody point me in the right direction? There doesn’t seem to be a lot of help in this regard.
I would need something that would lock just the classes that I have made while still leaving the rest. My understanding is that the mde would compile the whole works, and therefore would not work. Is that correct?
Could you have 2 projects for 1 mdb file? Then I could allow 1 project to be locked (mine) and then the other to be open to everyone
Marty Habicht
An add-in may suit: http://msdn.microsoft.com/en-us/library/aa902693.aspx
You can create an mde and include it as a refernce in other Access applications (code window, Tools-References).
See my Add-in Tips, Hints and Gotchas page for an Access only answer.
A simple solution would be to put the classes in an mde, and then just set a reference to the MDE from the unlocked project. This will give you access to the class, while rendering your source unviewable. This won't stop a determined reverser, but I don't really think a determined reverser is in the threat model:)