473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

need a way

I am looking for a way to have an application that is running in the
background serve data to other applications that only live for short periods
of time.

MainA runs all the time. It reads data from a disk(s) and loads it into some
type of memory, pipe or mailbox.

MainB then runs and has the ability to access the data MainA put in the
queue.

MainC then tells MainA to refresh the queue.

MainB then runs and accesses the new data.

Is this possible?

Am I missing something simple?
Nov 17 '05 #1
3 1016
Hi !

You need two things. First is a shared memory section that is accessible by
many processes. Being accessible by multiple processes means that many
'applications' can access it. In Windows terms, each application that is
executed runs as a process. So, this type of data exchange is called
Interprocess Communication or IPC. More on this later.

The second thing you need is some sort of a messaging system. The most
efficient way, in Windows, is of course Windows Messaging (WM_). This means
that your MainA has a single thread, with one window object. It can respond
to a message called WM_CUSTOM_REFRESH_DATA, for example, and if this message
is not posted, the thread sleeps.

MainB uses the shared memory access to get data from the shared memory
section. This is quite trivial, see MSDN for CSharedFile if you're using
MFC. If not, then a named pipe is the solution.

MainC is responsible for sending the WM_CUSTOM_REFRESH_DATA to MainA. Note
that using Windows Messaging requires the applications to have a window that
will receive the data. Invisible, 0-sized window objects are a very
effective way and consume only minimal amount of resources.

So, you're not missing anything, it's just about doing it.

-Antti Keskinen
"bill" <wj****@hotmail.com> wrote in message
news:11*************@corp.supernews.com...
I am looking for a way to have an application that is running in the
background serve data to other applications that only live for short
periods of time.

MainA runs all the time. It reads data from a disk(s) and loads it into
some type of memory, pipe or mailbox.

MainB then runs and has the ability to access the data MainA put in the
queue.

MainC then tells MainA to refresh the queue.

MainB then runs and accesses the new data.

Is this possible?

Am I missing something simple?

Nov 17 '05 #2
Great. I figured there was a way with IPC, just wasn't sure where to start.
Now the last question,,, The shared memory system I am going to build needs
to work between two different types of applications. MainA and MainC can be
MFC VC++ apps. But I need to access the data through a mex file,, in others
words MainB will be a MEX file running from Matlab. So it won't be MFC or
even windows api for that matter.

Any ideas?

I now have something to do this weekend!

Thanks


"Antti Keskinen" <an************@REMOVEME.ee.tpu.fi> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
Hi !

You need two things. First is a shared memory section that is accessible
by many processes. Being accessible by multiple processes means that many
'applications' can access it. In Windows terms, each application that is
executed runs as a process. So, this type of data exchange is called
Interprocess Communication or IPC. More on this later.

The second thing you need is some sort of a messaging system. The most
efficient way, in Windows, is of course Windows Messaging (WM_). This
means that your MainA has a single thread, with one window object. It can
respond to a message called WM_CUSTOM_REFRESH_DATA, for example, and if
this message is not posted, the thread sleeps.

MainB uses the shared memory access to get data from the shared memory
section. This is quite trivial, see MSDN for CSharedFile if you're using
MFC. If not, then a named pipe is the solution.

MainC is responsible for sending the WM_CUSTOM_REFRESH_DATA to MainA. Note
that using Windows Messaging requires the applications to have a window
that will receive the data. Invisible, 0-sized window objects are a very
effective way and consume only minimal amount of resources.

So, you're not missing anything, it's just about doing it.

-Antti Keskinen
"bill" <wj****@hotmail.com> wrote in message
news:11*************@corp.supernews.com...
I am looking for a way to have an application that is running in the
background serve data to other applications that only live for short
periods of time.

MainA runs all the time. It reads data from a disk(s) and loads it into
some type of memory, pipe or mailbox.

MainB then runs and has the ability to access the data MainA put in the
queue.

MainC then tells MainA to refresh the queue.

MainB then runs and accesses the new data.

Is this possible?

Am I missing something simple?


Nov 17 '05 #3
bill wrote:
Great. I figured there was a way with IPC, just wasn't sure where to
start. Now the last question,,, The shared memory system I am going
to build needs to work between two different types of applications.
MainA and MainC can be MFC VC++ apps. But I need to access the data
through a mex file,, in others words MainB will be a MEX file running
from Matlab. So it won't be MFC or even windows api for that matter.

Any ideas?


According to what I could find in a quick search of google, MEX files are
simply functions written in C that conform to a MATLAB imposed external API.

Within that function you can do anything you want, including use MFC or
access parts of the Win32 API, including your shared section and
synchronization mechanisms..

The compiled MEX file produces a DLL that's loaded by MATLAB.

-cd
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sofia | last post by:
My name is Sofia and I have for many years been running a personals site, together with my partner, on a non-profit basis. The site is currently not running due to us emigrating, but during its...
6
by: Robert Maas, see http://tinyurl.com/uh3t | last post by:
System login message says PHP is available, so I tried this: http://www.rawbw.com/~rem/HelloPlus/h.php It doesn't work at all. Browser just shows the source. What am I doing wrong?
0
by: Gregory Nans | last post by:
hello, i need some help to 'tree-ify' a string... for example i have strings such as : s = """A(here 's , B(A ) silly test) C(to show D(what kind) of stuff i need))""" and i need to...
7
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a...
8
by: JustSomeGuy | last post by:
I need to write an new class derived from the list class. This class stores data in the list to the disk if an object that is added to the list is over 1K in size. What methods of the std stl...
3
by: Bob.Henkel | last post by:
I write this to tell you why we won't use postgresql even though we wish we could at a large company. Don't get me wrong I love postgresql in many ways and for many reasons , but fact is fact. If...
2
by: Michael R. Pierotti | last post by:
Dim reg As New Regex("^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$") Dim m As Match = reg.Match(txtIPAddress.Text) If m.Success Then 'No need to do anything here Else MessageBox.Show("You need to enter a...
8
by: skumar434 | last post by:
i need to store the data from a data base in to structure .............the problem is like this ....suppose there is a data base which stores the sequence no and item type etc ...but i need only...
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.