Click here to Skip to main content
15,881,413 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCResource execption Pin
ForNow3-Jul-12 15:40
ForNow3-Jul-12 15:40 
AnswerRe: CResource execption Pin
Richard MacCutchan3-Jul-12 22:23
mveRichard MacCutchan3-Jul-12 22:23 
GeneralRe: CResource execption Pin
ForNow4-Jul-12 2:18
ForNow4-Jul-12 2:18 
GeneralRe: CResource execption Pin
Richard MacCutchan4-Jul-12 3:35
mveRichard MacCutchan4-Jul-12 3:35 
GeneralI inserted IMPLEMENT_SERIAL, DECLARE_SERIAL can someone explain the usage the Run time macros Pin
ForNow4-Jul-12 12:17
ForNow4-Jul-12 12:17 
GeneralAND IT WORKED fogot that part Pin
ForNow4-Jul-12 12:18
ForNow4-Jul-12 12:18 
GeneralRe: I inserted IMPLEMENT_SERIAL, DECLARE_SERIAL can someone explain the usage the Run time macros Pin
Richard MacCutchan4-Jul-12 21:49
mveRichard MacCutchan4-Jul-12 21:49 
QuestionProblem in writing values to shared memory from another process Pin
manoharbalu3-Jul-12 2:41
manoharbalu3-Jul-12 2:41 
I have a Delphi application which Creates a shared memory uses CreateFileMapping, OpenFileMapping, MapViewOfFile functions.

Now I wanted to share the same memory for my MFC application. I used the OpenFileMapping, MapViewOfFile functions.

I created a structure exactly same in size as the Delphi application and mapped the structure object.
sample code:
HANDLE hMapObject2;
hMapObject2 = OpenFileMapping( FILE_MAP_ALL_ACCESS, FALSE, "PP101U3_SHARED");
if( !hMapObject2 )
{
AfxMessageBox("Failed to open Simpack DataBase");
return( 0 );
}
Simpack = ( struct SIMPACKDB *) MapViewOfFile( hMapObject2, FILE_MAP_ALL_ACCESS, 0, 0, 0 );
if( !Simpack )
{
AfxMessageBox("Failed to create Simpack File Map View");
return(0);
}
Esim->SPV1 = Simpack->SP_Z;I am able to read the values exactly correct for all the member variables in the structure.
But when I try to write value in the shared memory, its not changing. It shows the previous value immediately in the debugger watch window.

The value of Simpack->SP_Z[15] is 0.5010 as read from the shared memory which is got from the Delphi application. i.e., value set by the Delphi application
When I set or write the value of the same variable to the shared memory in my MFC Application using the code:

Simpack->SP_Z[15] = 0.6123;
or
float test = 0.6123;
memcpy( Simpack->SP_Z + 16, &test, sizeof(float));it still shows the previous value 0.5010 which is got from the Delphi Application. But When I change the same variable's value in the Delphi applicationit changes and the changed value can be read here in the MFC application.

Please help me to find why I am unable to write or set value in the shared memory from my MFC Application and suggest me with any code how to write the values in the shared memory from my MFC Application.
Is there anything wrong in the code?
Is this happening because I am sharing the memory that is created by a Delphi Application from a MFC Application? i.e., Sharing memory between Delphi and MFC Application is not allowed.
AnswerRe: Problem in writing values to shared memory from another process Pin
Richard Andrew x644-Jul-12 12:46
professionalRichard Andrew x644-Jul-12 12:46 
GeneralRe: Problem in writing values to shared memory from another process Pin
manoharbalu4-Jul-12 19:14
manoharbalu4-Jul-12 19:14 
QuestionA guide or survey on software integration techniques Pin
m.salsal2-Jul-12 20:33
m.salsal2-Jul-12 20:33 
AnswerRe: A guide or survey on software integration techniques Pin
Maximilien3-Jul-12 0:48
Maximilien3-Jul-12 0:48 
GeneralRe: A guide or survey on software integration techniques Pin
hr.nasr6-Jul-12 20:48
hr.nasr6-Jul-12 20:48 
GeneralRe: A guide or survey on software integration techniques Pin
Maximilien7-Jul-12 3:28
Maximilien7-Jul-12 3:28 
Questionhow abstract and interface used in real time application? Pin
shanmugarajaa2-Jul-12 19:27
shanmugarajaa2-Jul-12 19:27 
AnswerRe: how abstract and interface used in real time application? Pin
_AnsHUMAN_ 2-Jul-12 19:57
_AnsHUMAN_ 2-Jul-12 19:57 
AnswerRe: how abstract and interface used in real time application? Pin
Richard MacCutchan2-Jul-12 21:36
mveRichard MacCutchan2-Jul-12 21:36 
QuestionStrange compiler output Pin
ForNow2-Jul-12 17:50
ForNow2-Jul-12 17:50 
AnswerRe: Strange compiler output Pin
«_Superman_»2-Jul-12 20:53
professional«_Superman_»2-Jul-12 20:53 
GeneralRe: Strange compiler output Pin
ForNow3-Jul-12 2:46
ForNow3-Jul-12 2:46 
QuestionHow to configure GTK+ in CodeBlocks? Pin
atoi_powered2-Jul-12 4:07
atoi_powered2-Jul-12 4:07 
AnswerRe: How to configure GTK+ in CodeBlocks? Pin
Richard MacCutchan2-Jul-12 6:41
mveRichard MacCutchan2-Jul-12 6:41 
General[solved] CDialog Goes Blank When Press ENTER Pin
AmbiguousName2-Jul-12 0:32
AmbiguousName2-Jul-12 0:32 
QuestionRe: CDialog Goes Blank When Press ENTER Pin
Code-o-mat2-Jul-12 1:03
Code-o-mat2-Jul-12 1:03 
AnswerRe: CDialog Goes Blank When Press ENTER Pin
AmbiguousName2-Jul-12 1:18
AmbiguousName2-Jul-12 1:18 

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.