Communication between two programs?
I need to communicate between two programs. One of the programs is in C++, however the other is in VB6. I need to pass the address of the hDC of a form in the VB6 program to my C++ program. I thought to save the address of the hDC to a file and read it in C++ but I don't know how to turn "-1409218589"(what just got output to the file I saved in VB6) to an address in C++. Character array to address?
Is there another way?
# 1 Re: Communication between two programs?
AFAIK, the hdc from one program is meaningless to another program. The reason being is that this handle is just a pointer to a memory location in the process' space - so it's process centric only.
On the other hand, some types of handles can be passed to other processes by using the DuplicateHandle (http://msdn2.microsoft.com/en-us/library/ms724251.aspx) api. This function converts a handle value from one process into a value that another process can use. Unfortunately, DuplicateHandle doesn't work for device context handles.
Arjay at 2007-11-9 13:32:52 >
