Click here to Skip to main content
14,700,220 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Difference between current system time and time from user input in c Pin
Richard MacCutchan1-Nov-20 22:58
mveRichard MacCutchan1-Nov-20 22:58 
AnswerRe: Difference between current system time and time from user input in c Pin
Daniel Pfeffer31-Oct-20 12:24
professionalDaniel Pfeffer31-Oct-20 12:24 
QuestionSearching and displaying a record in Array of Structure in c Pin
Member 1497910829-Oct-20 17:45
MemberMember 1497910829-Oct-20 17:45 
AnswerRe: Searching and displaying a record in Array of Structure in c Pin
CPallini29-Oct-20 22:27
mveCPallini29-Oct-20 22:27 
QuestionHow to convert my MDI Application to open each window as a separate instance of the application Pin
manoharbalu23-Oct-20 1:09
Membermanoharbalu23-Oct-20 1:09 
AnswerRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
trønderen23-Oct-20 1:34
Membertrønderen23-Oct-20 1:34 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
manoharbalu23-Oct-20 1:49
Membermanoharbalu23-Oct-20 1:49 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
trønderen23-Oct-20 9:04
Membertrønderen23-Oct-20 9:04 
I do not work with MFC myself, so this is just results from a little documentation searching.

TCP/IP is certainly not a lightweight mechanism, but pipes are. In the original Unix design (from the early 1970s), the processes in either end had to have a common ancestor, creating the pipe, but later we got named pipes, CreateNamedPipeA function[^] so that arbitrary processes can communicate across them. This has far less overhead than an TCP/IP socket.

You also have the CSharedFile Class[^] and CMemFile Class[^], making RAM look like a file; you use file operations to access RAM.

There is the opposite function: To make a disk file look like RAM, a "memory mapped file". In the old days, you couldn't do that from C#, you had to use C/C++. Now I find only the dotNet version (at MemoryMappedFile Class[^]), but of course it is still is provided in C/C++; I just can't find it Smile | :) (I would think that CSharedFile and CMemFile are thin layers on top of that mechanism.) You may be more clever than I am in finding the C++ equivalent. It is there, somewhere...

A memory mapped file does not require an underlaying disk file; you use the same facility for creating a data segment accessible from multiple processes. Using a shared segment, a.k.a. a memory mapped file, is certainly the fastest way to exchange data between processes, comparable to threads accessing shared data within a process: The memory management system handles it. The greatest advantage, compared to a file/pipe solution: You don't have to serialize (or marshal, or whatever your call it) your data structures, but can access them "as is". For pointer based structures, all processes accessing the shared data segment obviously must map it to the same logical address. Equally obvious: You are responsible for all synchronization yourself, which must be done with semaphores (or whatever higher level mechanism) at system level, available to all processes. It will be somewhat more costly than a single-process implementation, but it doesn't have to be much, especially if there a single process (the server) updating the data, other processes only reading/displaying them.
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
Victor Nijegorodov23-Oct-20 9:35
MemberVictor Nijegorodov23-Oct-20 9:35 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
trønderen23-Oct-20 10:32
Membertrønderen23-Oct-20 10:32 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
Victor Nijegorodov23-Oct-20 11:26
MemberVictor Nijegorodov23-Oct-20 11:26 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
manoharbalu26-Oct-20 1:07
Membermanoharbalu26-Oct-20 1:07 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
Victor Nijegorodov26-Oct-20 1:34
MemberVictor Nijegorodov26-Oct-20 1:34 
GeneralRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
manoharbalu23-Oct-20 3:35
Membermanoharbalu23-Oct-20 3:35 
SuggestionRe: How to convert my MDI Application to open each window as a separate instance of the application Pin
David Crow23-Oct-20 3:46
MemberDavid Crow23-Oct-20 3:46 
Questionqueues to find minimum time to serve all. Pin
fecomevi21-Oct-20 23:22
Memberfecomevi21-Oct-20 23:22 
AnswerRe: queues to find minimum time to serve all. Pin
trønderen22-Oct-20 1:04
Membertrønderen22-Oct-20 1:04 
AnswerRe: queues to find minimum time to serve all. Pin
Richard MacCutchan22-Oct-20 1:16
mveRichard MacCutchan22-Oct-20 1:16 
QuestionRe: queues to find minimum time to serve all. Pin
David Crow22-Oct-20 4:58
MemberDavid Crow22-Oct-20 4:58 
QuestionAbort Retry and Ignore and SEH Pin
ForNow19-Oct-20 16:57
MemberForNow19-Oct-20 16:57 
AnswerRe: Abort Retry and Ignore and SEH Pin
Victor Nijegorodov19-Oct-20 21:49
MemberVictor Nijegorodov19-Oct-20 21:49 
AnswerRe: Abort Retry and Ignore and SEH Pin
Richard MacCutchan19-Oct-20 22:21
mveRichard MacCutchan19-Oct-20 22:21 
GeneralRe: Abort Retry and Ignore and SEH Pin
trønderen19-Oct-20 23:28
Membertrønderen19-Oct-20 23:28 
GeneralRe: Abort Retry and Ignore and SEH Pin
ForNow20-Oct-20 2:41
MemberForNow20-Oct-20 2:41 
GeneralRe: Abort Retry and Ignore and SEH Pin
trønderen20-Oct-20 6:20
Membertrønderen20-Oct-20 6:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.