Jump to content
Sign in to follow this  
evk

sharing info over multiple programs

Recommended Posts

evk

I'm running a program that loops continuously reading data over a comm port and writing it to an ini file. Another program reads this information and uses it to perform some complicated action. The problem is that when both programs try to access the file at the same time, the program that needs the input bounces back the default parameter in the iniread. <-- that is a very bad thing for the program (unexpected action). Does anyone have any suggestions to completely eliminate this problem? Thanks.

Share this post


Link to post
Share on other sites
monoceres

Hi!

Couldn't a simple loop like this solve the problem?

Do
    $data=IniRead("bla.ini","section","key","error")
Until $data<>"error"

.. Or if you want to share data directly between programs you can use several methods.

  • ReadProcessMemory/WriteProcessMemory
  • Pipes
  • Mutex
  • Messages

Search around for them, they are used quite often :)


Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.