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

VC++/ DLL question

Status
Not open for further replies.

Vallurupa

Programmer
Oct 17, 2001
38
US
Hi,

I am calling one DLL by two different processes (Two exe files.) How can i do process to process comunication between two instances of the same dll.
I have to access the window handle here.

I coded like this .. it is not working
#pragma data_seg (".mydata")

HWND hStimWnd1=NULL;
char *test=" ";
#pragma data_seg()
In .def file /SECTION:.mydata,RWS

Is there any other way to declare the variables, which can be shared in the process time with the other processes.

Please help me

thanks

Prasad

tiaacus@yahoo.com
 
With the #pragma I use this to count process instances:

#pragma data_seg("Usage")
long Usage_Count = 0;
#pragma data_seg()

#pragma comment(linker, "/section:Usage,rws")

I'm not sure, that it will work for Your application.
Why not make interprocess communication with SendMessage()? You can enum all windows by starting/loading of DLL, find hwnd of your Processes and then use SendMessage()...
You could use CreateRemoteThread() for interprocess communication too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top