Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shared Data Between Programs

Status
Not open for further replies.

sweep123

Technical User
May 1, 2003
185
GB
I am using the following scheme to share data between instances of the same program.
However can I use this scheme for sharing this data with the program that initiates these programs?

#pragma data_seg(".ID_DATA")

bool gb_1 = false; // In use flag for ID 1
bool gb_2 = false; // In use flag for ID 2
bool gb_3 = false; // In use flag for ID 3
bool gb_4 = false; // In use flag for ID 4
bool gbKeyPressed_1 = false; // Key pressed flag for ID 1
bool gbKeyPressed_2 = false; // Key pressed flag for ID 2
bool gbKeyPressed_31 = false; // Key pressed for IDU 3 ID 1 handle
bool gbKeyPressedID_32 = false; // Key pressed for ID 4 ID 2 handle
bool gbKeyPressedID_41 = false; // Key pressed for ID 3 ID 1 handle
bool gbKeyPressedID_42 = false; // Key pressed for ID 4 ID 2 handle
unsigned int gwA429_ID1 = 0; // key data for ID 1
unsigned int gwA429_ID2 = 0; // key data for ID 2
unsigned int gwA429_ID3 = 0; // key data for ID 3
unsigned int gwA429_ID4 = 0; // key data for ID 4
short giTransferID1 = 0; // Label ID for ID 1 transfer
short giTransferID2 = 0; // Label ID for ID 2 transfer
short giTransferID3 = 0; // Label ID for ID 3 transfer
short giTransferID4 = 0; // Label ID for ID 4 transfer
char gs1Key[6] = {' ', ' ', ' ', ' ' , ' ', '\0'}; // Name of last ID 1 key press
char gs2Key[6] = {' ', ' ', ' ', ' ' , ' ', '\0'}; // Name of last ID 2 key press
char gs3Key[6] = {' ', ' ', ' ', ' ' , ' ', '\0'}; // Name of last ID 3 key press
char gs4Key[6] = {' ', ' ', ' ', ' ' , ' ', '\0'}; // Name of last ID 4 key press
HANDLE ghMutex = NULL; // Mutex for controlled access to this data area

#pragma data_seg()
#pragma comment(linker, "/SECTION:.ID_DATA,RWS")

The calling program can see the bools, but not the char data.

Is this scheme only applicable to multiple instancs of the same program?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top