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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link between two exe files with the DLL

Status
Not open for further replies.

Vallurupa

Programmer
Oct 17, 2001
38
US
Hi
I am calling one c++ DLL from two different exe files. there are 4 functions in the DLL. Each EXE calls different functions in the DLL.
Now I have to pass values from one exe to other exe through DLL. I have declared veriables as global.I am not using any CLASSES in the code.
How can i pass the values.

Please help me

Thankyou

Tiaa
tiaacus@yahoo.com
 
in the source of the dll:

#pragma data_seg ("some_custom_name")

// Here all the global variables you want to share
// It is required for each of them to have a value,
// otherwise they go to the uninitialized data segment

// for example, if you want to share a counter:

DWORD dwCounter = 0;

#pragma data_seg ( )

// Here the non-shared global variables

When linking the dll, add "/SECTION:some_custom_name,RWS" (without the quotes) to the linker options. The some_custom_name in the linker command must match (case sensitive) the first #pragma data_seg statement.

Marcel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top