473,241 Members | 1,631 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,241 software developers and data experts.

Sending Data over Shared Memories (MFC)

Hi,

I want to develop a program, that transmits several classes between two
processes. It should be built after the guidelines of the
iso/osi-reference model and work with a shared memory. At the moment I
copy all the data into a buffer, add the specific overhead and send
them to the memory. But if the data contains any strings, it adds only
the pointer and not the string itsself. How can I realize, that the
program copies the string and not the pointer into "pBuffer"? I have
already looked at serialization and streams, but it still didn't work.

Anyone knows, how to handle this problem?
The structure for the data transport looks like this:

struct SDataModule // layer 7 module
{
long commandCount; // number of elements in the buffer
char pBuffer[MAX_COUNT_BYTES]; // storage buffer
};

struct STransportModule // layer 4 module
{
long seqNumber; // a sequence number to mark each block
SDataModule data; // the data to transport
};

struct SNetworkModule // layer 3 module
{
char source[16]; // the ip from the user computer
STransportModule transport; // the data to transport
};

struct SMemoryModule // layer 1 module
{
BOOL full; // indication that the shared memory is full
SNetworkModule network; // the data to transport
};
TIA
Volker Nitschke

Jul 11 '06 #1
2 2788
<vo*************@gmx.dewrote:
(MFC question)
That's strictly Microsoft stuff. Has nothing to do with C++.

Ask HERE instead:

comp.os.ms-windows.programmer.win32 (I set followup here.)

--
Cheers,
Robbie Hatley
East Tustin, CA, USA
lone wolf intj at pac bell dot net
(put "[usenet]" in subject to bypass spam filter)
http://home.pacbell.net/earnur/
Jul 11 '06 #2
<vo*************@gmx.dewrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
Hi,

I want to develop a program, that transmits several classes between two
processes. It should be built after the guidelines of the
iso/osi-reference model and work with a shared memory. At the moment I
copy all the data into a buffer, add the specific overhead and send
them to the memory. But if the data contains any strings, it adds only
the pointer and not the string itsself. How can I realize, that the
program copies the string and not the pointer into "pBuffer"? I have
already looked at serialization and streams, but it still didn't work.

Anyone knows, how to handle this problem?
The structure for the data transport looks like this:

struct SDataModule // layer 7 module
{
long commandCount; // number of elements in the buffer
char pBuffer[MAX_COUNT_BYTES]; // storage buffer
};

struct STransportModule // layer 4 module
{
long seqNumber; // a sequence number to mark each block
SDataModule data; // the data to transport
};

struct SNetworkModule // layer 3 module
{
char source[16]; // the ip from the user computer
STransportModule transport; // the data to transport
};

struct SMemoryModule // layer 1 module
{
BOOL full; // indication that the shared memory is full
SNetworkModule network; // the data to transport
};
Those structures are interesting, but not much help without telling us what
you are trying to do with them. Nor are you showing us the structures.

Quote: "But if the data contains any strings, it adds only the pointer and
not the string itsself."

What is this "it" you are refering to? A function? A method? An
assignment?

Your answer may be as simple as how to use strncpy or memcpy or an iterator.
Or not. Show us what you are trying to do that is not working.
Jul 12 '06 #3

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

Similar topics

3
by: Jan Holland | last post by:
I am trying to install pear on a shared server/host following the instructions from: <http://uk.builder.com/architecture/web/0,39026570,20283197,00.htm> So I made a subdir on my site like:...
5
by: CristianMori | last post by:
Hi there Is there a way in .NET to do shared memories between applications running on the same machine? Thanks
5
by: Ian Bell | last post by:
What is the current thinking on the best way to solve the shared memory problem? Ian -- Ian Bell
3
by: Greg | last post by:
I seek to understand ATL better. When I create a Win32 Project (App or DLL) the option to add support for ATL (or MFC) is not selectable. It is only selectable for a Win32 Console App. However, it...
9
by: Sandy | last post by:
can mfc application, send text data to opened notepad file in desktop?(live transfer of data) . can anybody help
1
by: | last post by:
Hi I used shared memory quite a lot for IPC. The problem is that it is fixed size so that you cannot place something like a CString in it because CString will load it's buffer from the local...
1
by: Henk | last post by:
Hi, I have a problem with sending a file. I have a client application that connects to a server and sends the string "data". Then it sends a file. If the server receives "data", the method...
8
by: bonk | last post by:
Is it generally OK for an EXE that has MFC linked statically to load an use another DLL wich has MFC linked as shared DLL ? To be more specific: I have an EXE that links a lib. Let's call it...
15
by: colin | last post by:
Hi, Im familiar with c,c++ etc, and Ive spent a week trying to write my first app in c# it works reasonably well, but im having difficulty getting to grips with inter thread signalling etc. I...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.