ADXIESharedMemory

Add-in Express™ Support Service
That's what is more important than anything else

ADXIESharedMemory
 
orange_roughy




Posts: 25
Joined: 2012-06-22
Hi,

I am using C#, but http://www.add-in-express.com/creating-addins-blog/2009/06/19/internet-explorer-plugin-settings-synchronize/ is written by VB. Is there a C# sample? I'm having difficulty converting LoadOptions(), SaveOptions(), UpdateOptions(), RefreshOptions(), and CloseOptions().

thank you,
orange_roughy
Posted 22 Jun, 2012 22:14:02 Top
orange_roughy




Posts: 25
Joined: 2012-06-22
Ah, well I see ADXIESharedMemory acts like an array. So I can write:


mySharedMemory[0] = "foo";
mySharedMemory[1] = "bar";


but still might have questions later...
Posted 22 Jun, 2012 22:17:07 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Eric,

The HowTo: Synchronize settings of an IE plug-in article has two sample add-on projects attached: C# and VB.NET.

Good luck with your add-on project!
.NET, Extended MAPI, Windows Phone & RT
Posted 23 Jun, 2012 15:15:15 Top
orange_roughy




Posts: 25
Joined: 2012-06-22
Eugene Astafiev writes:
Good luck with your add-on project!


Thanks, Eugene. I have a question about synchronization. It is a design question.

The sample appears overly complex. After click "Apply" button, why not:

1. Save options to disk
2. SendMessageToAll, telling all instances to read options from disk
3. Instances open settings file in READ-ONLY mode, read settings, apply to GUI and internal state, close file.

Thanks.
Posted 24 Jun, 2012 19:15:14 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Eric,

Of course, you can use the approach described above. However, please note that writing and reading files from a disk takes much time as a rule. The better and faster way is to use a shared memory.
.NET, Extended MAPI, Windows Phone & RT
Posted 25 Jun, 2012 03:12:16 Top
orange_roughy




Posts: 25
Joined: 2012-06-22
Thanks for the reply. For my application, settings are changed very infrequently. So, reading from disk is OK. Complexity of shared memory with locks/mutexes, etc. is not required.

thanks for the help!
Posted 25 Jun, 2012 08:46:13 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
You are welcome, Eric!
.NET, Extended MAPI, Windows Phone & RT
Posted 25 Jun, 2012 08:56:53 Top