Re: need a way
From: bill (wjfwjr_at_hotmail.com)
Date: 02/15/05
- Next message: Carl Daniel [VC++ MVP]: "Re: unboxing : Please tell me the difference"
- Previous message: Jochen Kalmbach: "Re: LPCSTR from String"
- In reply to: Antti Keskinen: "Re: need a way"
- Next in thread: Carl Daniel [VC++ MVP]: "Re: need a way"
- Reply: Carl Daniel [VC++ MVP]: "Re: need a way"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 15 Feb 2005 06:56:51 -0500
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" <antti.keskinen@REMOVEME.ee.tpu.fi> wrote in message
news:eGGqlLzEFHA.3936@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" <wjfwjr@hotmail.com> wrote in message
> news:1112ab13npro7d1@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?
>>
>
>
- Next message: Carl Daniel [VC++ MVP]: "Re: unboxing : Please tell me the difference"
- Previous message: Jochen Kalmbach: "Re: LPCSTR from String"
- In reply to: Antti Keskinen: "Re: need a way"
- Next in thread: Carl Daniel [VC++ MVP]: "Re: need a way"
- Reply: Carl Daniel [VC++ MVP]: "Re: need a way"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|