How to communicate from One Application to Another Application

G

Guest

Hi,
I have an Application running on Windows Mobile 5.0 device.
I want to pass some commands from one application on this device to another
application on the device.

I learned about Windows messaging, and know i can make an unmanaged call to
postmessage or sendmessage.

[DllImport("coredll.dll")]
public extern static int SendMessage(IntPtr hwnd, uint msg, uint wParam,
uint lParam);
[DllImport("coredll.dll")]
public extern static int PostMessage(IntPtr hwnd, uint msg, uint wParam,
uint lParam);

I want to know how do i read a user message posted to one of the forms in my
application.

Please suggest me if there is any other better way of communicating from one
application to another application.

Thanks in Advance,
Murthy
 
G

Guest

Hi,
Thanks for ur prompt Respose.
i came across some sample code but they are not working for windows mobile 5.0
It is giving me the following error.
Error 1 The type or namespace name 'Message' could not be found (are you
missing a using directive or an assembly reference?)

i am able to post message from form1 of App1 to form2 of App2, but i am do
know how to read the posted message in C#.

Any sample code is very much appreciated.

Thanks in Advance,
Murthy


Peter Foot said:
The definitive list of Inter-process communication methods is in this
two-part article:-
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-1.html
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-2.html

Peter

--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com

Murthy said:
Hi,
I have an Application running on Windows Mobile 5.0 device.
I want to pass some commands from one application on this device to
another
application on the device.

I learned about Windows messaging, and know i can make an unmanaged call
to
postmessage or sendmessage.

[DllImport("coredll.dll")]
public extern static int SendMessage(IntPtr hwnd, uint msg, uint wParam,
uint lParam);
[DllImport("coredll.dll")]
public extern static int PostMessage(IntPtr hwnd, uint msg, uint wParam,
uint lParam);

I want to know how do i read a user message posted to one of the forms in
my
application.

Please suggest me if there is any other better way of communicating from
one
application to another application.

Thanks in Advance,
Murthy
 
M

Mark Arteaga

Try adding a reference to Microsoft.WindowsCE.Forms.

--
Mark Arteaga
Principal Partner
OpenNETCF Consulting
http://www.opennetcf.com | http://blog.markarteaga.com
Hi,
Thanks for ur prompt Respose.
i came across some sample code but they are not working for windows
mobile 5.0
It is giving me the following error.
Error 1 The type or namespace name 'Message' could not be found (are
you
missing a using directive or an assembly reference?)
i am able to post message from form1 of App1 to form2 of App2, but i
am do know how to read the posted message in C#.

Any sample code is very much appreciated.

Thanks in Advance,
Murthy
Peter Foot said:
The definitive list of Inter-process communication methods is in this
two-part article:-
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-1.html
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-2.html

Peter

--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com
Hi,
I have an Application running on Windows Mobile 5.0 device.
I want to pass some commands from one application on this device to
another
application on the device.
I learned about Windows messaging, and know i can make an unmanaged
call
to
postmessage or sendmessage.
[DllImport("coredll.dll")]
public extern static int SendMessage(IntPtr hwnd, uint msg, uint
wParam,
uint lParam);
[DllImport("coredll.dll")]
public extern static int PostMessage(IntPtr hwnd, uint msg, uint
wParam,
uint lParam);
I want to know how do i read a user message posted to one of the
forms in
my
application.
Please suggest me if there is any other better way of communicating
from
one
application to another application.
Thanks in Advance,
Murthy
 
D

Daniel Moth

i came across some sample code but they are not working for windows mobile
So you came across some sample code that is not working, you don't tell us
where and you expect someone to help with the specific sample code?
Error 1 The type or namespace name 'Message' could not be found (are you
missing a using directive or an assembly reference?)
That means that you are either missing a reference to an assembly (that has
the code you are trying to use) or that you are missing a using directive
for the namespace (that has the code that you are trying to use). Mark has
helped you further. If after adding the reference you still see this error,
then it is the using directive that is missing. Right click on 'Message' and
click "Resolve".
i am able to post message from form1 of App1 to form2 of App2, but i am do
know how to read the posted message in C#.
At a guess you are trying to send windows messages between two windows forms
applications. So you can use Microsoft.WindowsCE.Forms assembly/namespace.
*Read* the contents of the 4 links from item 3 on the 1st link that Peter
Foot replied with first.

Good luck!

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

Murthy said:
Hi,
Thanks for ur prompt Respose.
i came across some sample code but they are not working for windows mobile
5.0
It is giving me the following error.
Error 1 The type or namespace name 'Message' could not be found (are you
missing a using directive or an assembly reference?)

i am able to post message from form1 of App1 to form2 of App2, but i am do
know how to read the posted message in C#.

Any sample code is very much appreciated.

Thanks in Advance,
Murthy


Peter Foot said:
The definitive list of Inter-process communication methods is in this
two-part article:-
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-1.html
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-2.html

Peter

--
Peter Foot
Device Application Development MVP
www.peterfoot.net | www.inthehand.com

Murthy said:
Hi,
I have an Application running on Windows Mobile 5.0 device.
I want to pass some commands from one application on this device to
another
application on the device.

I learned about Windows messaging, and know i can make an unmanaged
call
to
postmessage or sendmessage.

[DllImport("coredll.dll")]
public extern static int SendMessage(IntPtr hwnd, uint msg, uint
wParam,
uint lParam);
[DllImport("coredll.dll")]
public extern static int PostMessage(IntPtr hwnd, uint msg, uint
wParam,
uint lParam);

I want to know how do i read a user message posted to one of the forms
in
my
application.

Please suggest me if there is any other better way of communicating
from
one
application to another application.

Thanks in Advance,
Murthy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top