MessageWindow

  • Thread starter Thread starter Ron
  • Start date Start date
R

Ron

Hi All,

I use the MessageWindow in my Pocket PC / WinCE.net class. From native
code, I send a windows message to managed code to perform a certain action.
Can I use the MessageWindow in the Full framework as well? I like to use the
same class in Full and compact framework. If I cannot, what can I use to
achieve the same sort of communication between native and managed?

Any feedback is appreciated!

Thanks!
 
There is no MessageWindow class in the full framework. Nor it is really
needed there. In the full framework you can send messages to any control
since the Control class exposes Handle property. For consistency you can
create your own MessageWindow class derived from Control and use it on the
desktop
 
Hi Ron

The answer is pretty clear.
You can use MessageWindow in both plateformes (.NET and .NET
CompactFramework)?
You can also use events anbd broadcaster in both plateformes.
If you want a good example of these two solutions, I would give you
the following url (a msdn article):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/asynchcallbacks.asp

However, if I were you, in the .NET (Full Framework) I would use the
delegates (that are kind of pointers of functions) and i would pass
the delegate to your native function thanks the P/Invoke feature of
C#.
This delegate passing is not supported on .NET CF, that is why we have
to use the events and broadcaster or MessageWindow to discuss between
native and managed code. This is not so pretty.
If you want a good example on how to use a delegate and how to pass a
delegate to a native function go to the following URL

http://msdn.microsoft.com/library/d...ry/en-us/cpguide/html/cpconcallbacksample.asp

In Summary, I would advice you to use the following ways:

..NET <=> delegate passing to native function
..NET CF <=> MessageWindow or events(cleaner but not always applicable)
according the your case.

I am a bit in the same situation for now so Good luck (but the URLs i
gave you are good)
HTH

HK
 
"The MessageWindow is in the Microsoft.WindowsCE.Forms namespace." - MSDN
documentation

So, as Alex F indicated, it is not available on the desktop.

- K.
 
Back
Top