Another alternative is to use SendMessage with WM_COPYDATA. The wParam contains
the HWND of the window passing the data, and the LPARAM is a pointer to a
COPYDATASTRUCT. In the other process, write a WM_COPYDATA handler to fetch the
data and perform the callback functions.
jcc
----- Original Message ----
From: Paul Yao <paul@xxxxxxxxxxx>
To: windowsce-dev@xxxxxxxxxxxxxxx
Sent: Monday, November 6, 2006 9:20:47 AM
Subject: RE: [windowsce-dev] Callback function calls across process?
The ::SendMessage is guaranteed to work across process boundaries.
I wonder if you are having problems because of the parameters that you
are passing. I am going to make a guess here -- that you are including
one (or more) pointers in your SendMessage call. If this is true, then
it is the pointer -- and not the function call -- that is the problem.
To fix this problem, you can put your pointers into a shared memory
area. To allocate memory in a shared memory area, you need to call a
combination of several functions: (1) CreateFileMapping, and (2)
MapViewOfFile. Once you have allocated this shared memory area, copy
your parameters to this memory. Then use a pointer to this memory to
perform your inter-process SendMessage.
I made a few guesses here, so perhaps this will help or perhaps not. One
thing is clear, though: if you are using SendMessage, that function is
guaranteed to work across process boundaries.
Good luck!
Best,
Paul
-----Original Message-----
From: windowsce-dev@ yahoogroups. com
[
mailto:windowsce-dev@ yahoogroups. com] On Behalf Of Jain, Vatsalya
Sent: Sunday, November 05, 2006 9:20 PM
Hi all.
I need some advice.
My current requirement is to invoke some functions using callback
mechanism, and the functions to be called are present in a dll while the
calling code is in an exe. ( ire I need to make an IPC call for the
same)
I have been able to figure out callback could be used in the same
process using ::SendMessage( hwnd,...) call , but this API wont work
for across process calls.
Can anyone suggest how to go about the Inter process calls ?
Thanks in Advance,
Regards,
Vatsalya
[Non-text portions of this message have been removed]
Mailing list addresses:
Post message: windowsce-dev@xxxxxxxxxxxxxxx
Unsubscribe: windowsce-dev-unsubscribe@xxxxxxxxxxxxxxx
List owner: windowsce-dev-owner@xxxxxxxxxxxxxxx
Website:
http://groups.yahoo.com/group/windowsce-dev
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/windowsce-dev/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/windowsce-dev/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:windowsce-dev-digest@xxxxxxxxxxxxxxx
mailto:windowsce-dev-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
windowsce-dev-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/