Click here to Skip to main content
15,891,473 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: OnLButtonDblClk not working in CMainFrame Pin
Eugen Podsypalnikov17-Jun-12 20:28
Eugen Podsypalnikov17-Jun-12 20:28 
QuestionAdvantage Multicore over Multithread in core i7 Pin
shankha201015-Jun-12 21:53
shankha201015-Jun-12 21:53 
AnswerRe: Advantage Multicore over Multithread in core i7 - Repost Pin
Richard MacCutchan16-Jun-12 0:04
mveRichard MacCutchan16-Jun-12 0:04 
Questiondll application is not launching for some PCS Pin
appollosputnik15-Jun-12 2:34
appollosputnik15-Jun-12 2:34 
AnswerRe: dll application is not launching for some PCS Pin
Richard MacCutchan15-Jun-12 2:50
mveRichard MacCutchan15-Jun-12 2:50 
JokeRe: dll application is not launching for some PCS Pin
David Crow15-Jun-12 4:56
David Crow15-Jun-12 4:56 
GeneralRe: dll application is not launching for some PCS Pin
Richard MacCutchan15-Jun-12 5:09
mveRichard MacCutchan15-Jun-12 5:09 
QuestionProblem with writing values to Shared Memory Pin
manoharbalu15-Jun-12 0:59
manoharbalu15-Jun-12 0:59 
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 with writing values to Shared Memory Pin
Richard MacCutchan15-Jun-12 2:47
mveRichard MacCutchan15-Jun-12 2:47 
QuestionAdding checkboxes to the multiple columns of CListCtrl Pin
Ashish Ranjan Mishra15-Jun-12 0:24
Ashish Ranjan Mishra15-Jun-12 0:24 
AnswerRe: Adding checkboxes to the multiple columns of CListCtrl Pin
_AnsHUMAN_ 15-Jun-12 1:18
_AnsHUMAN_ 15-Jun-12 1:18 
AnswerRe: Adding checkboxes to the multiple columns of CListCtrl Pin
_Flaviu15-Jun-12 18:17
_Flaviu15-Jun-12 18:17 
QuestionDifference between goto and function calls Pin
CodingLover14-Jun-12 19:37
CodingLover14-Jun-12 19:37 
AnswerRe: Difference between goto and function calls Pin
Eugen Podsypalnikov14-Jun-12 20:31
Eugen Podsypalnikov14-Jun-12 20:31 
AnswerRe: Difference between goto and function calls Pin
Erudite_Eric14-Jun-12 20:51
Erudite_Eric14-Jun-12 20:51 
AnswerRe: Difference between goto and function calls Pin
Richard MacCutchan14-Jun-12 21:53
mveRichard MacCutchan14-Jun-12 21:53 
GeneralRe: Difference between goto and function calls Pin
Erudite_Eric15-Jun-12 21:40
Erudite_Eric15-Jun-12 21:40 
GeneralRe: Difference between goto and function calls Pin
Richard MacCutchan15-Jun-12 22:29
mveRichard MacCutchan15-Jun-12 22:29 
GeneralBug in ATL/MFC 8.0 CString Pin
XmlSeeker14-Jun-12 19:19
XmlSeeker14-Jun-12 19:19 
GeneralRe: Bug in ATL/MFC 8.0 CString Pin
Erudite_Eric14-Jun-12 20:54
Erudite_Eric14-Jun-12 20:54 
GeneralRe: Bug in ATL/MFC 8.0 CString Pin
Eugen Podsypalnikov14-Jun-12 20:59
Eugen Podsypalnikov14-Jun-12 20:59 
GeneralRe: Bug in ATL/MFC 8.0 CString Pin
XmlSeeker16-Jun-12 7:18
XmlSeeker16-Jun-12 7:18 
QuestionError with dynamic_cast Pin
msr_codeproject12-Jun-12 20:14
msr_codeproject12-Jun-12 20:14 
AnswerRe: Error with dynamic_cast Pin
Richard MacCutchan12-Jun-12 21:59
mveRichard MacCutchan12-Jun-12 21:59 
GeneralRe: Error with dynamic_cast Pin
msr_codeproject12-Jun-12 22:47
msr_codeproject12-Jun-12 22:47 

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.