473,385 Members | 1,983 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,385 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 2795
<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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.