Click here to Skip to main content
15,900,511 members
Home / Discussions / C#
   

C#

 
GeneralSendMessage issue Pin
Aviv Halperin23-Dec-04 10:32
Aviv Halperin23-Dec-04 10:32 
GeneralRe: SendMessage issue Pin
Matt Gerrans23-Dec-04 11:30
Matt Gerrans23-Dec-04 11:30 
GeneralRe: SendMessage issue Pin
Aviv Halperin23-Dec-04 13:12
Aviv Halperin23-Dec-04 13:12 
GeneralRe: SendMessage issue Pin
Heath Stewart23-Dec-04 20:57
protectorHeath Stewart23-Dec-04 20:57 
GeneralRe: SendMessage issue Pin
Aviv Halperin24-Dec-04 4:02
Aviv Halperin24-Dec-04 4:02 
GeneralRe: SendMessage issue Pin
Heath Stewart27-Dec-04 10:12
protectorHeath Stewart27-Dec-04 10:12 
GeneralRe: SendMessage issue Pin
Aviv Halperin27-Dec-04 20:41
Aviv Halperin27-Dec-04 20:41 
GeneralRe: SendMessage issue Pin
Heath Stewart28-Dec-04 5:01
protectorHeath Stewart28-Dec-04 5:01 
On what class they're defined shouldn't matter, but perhaps some of your overloads were conflicting.

With value types - like int - you do not need to pin them (see the GCHandle class, BTW). Reference types may be moved by the GC on the heap, but it depends how the message handler uses the data; you may not need to pin the memory. Strings are reference types but this data is typically used synchronously with SendMessage (PostMessage, on the other hand, is a different story). When passing addresses of reference objects (as IntPtr, or just a GCHandle which works, too, as well as a HandleRef) you should pin them.

For robust code, never use fixed-size integers for the WPARAM and LPARAM. Always use IntPtr. For 0, just use IntPtr.Zero and to wrap an int or long use new IntPtr(int) or new IntPtr(long), respectively.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralPrinting RichText text and image Pin
srunion23-Dec-04 9:53
srunion23-Dec-04 9:53 
GeneralRe: Printing RichText text and image Pin
Jay Shankar23-Dec-04 14:20
Jay Shankar23-Dec-04 14:20 
General.NET CF and SendMessage Pin
Aviv Halperin23-Dec-04 9:18
Aviv Halperin23-Dec-04 9:18 
GeneralXP Style problem Pin
Stanciu Vlad23-Dec-04 8:31
Stanciu Vlad23-Dec-04 8:31 
GeneralRe: XP Style problem Pin
Heath Stewart23-Dec-04 9:08
protectorHeath Stewart23-Dec-04 9:08 
GeneralSpellcheck in C#.NET Pin
saptarishi200123-Dec-04 8:26
saptarishi200123-Dec-04 8:26 
GeneralRegex problem Pin
Yaakov Davis23-Dec-04 7:09
Yaakov Davis23-Dec-04 7:09 
GeneralRe: Regex problem Pin
leppie23-Dec-04 7:41
leppie23-Dec-04 7:41 
GeneralRe: Regex problem Pin
Yaakov Davis23-Dec-04 7:56
Yaakov Davis23-Dec-04 7:56 
GeneralRe: Regex problem Pin
TyronX23-Dec-04 8:09
TyronX23-Dec-04 8:09 
GeneralRe: Regex problem Pin
leppie23-Dec-04 8:10
leppie23-Dec-04 8:10 
GeneralRe: Regex problem Pin
Yaakov Davis23-Dec-04 8:50
Yaakov Davis23-Dec-04 8:50 
GeneralQuestion about efficiency - Hashtable key types Pin
Tristan Rhodes23-Dec-04 6:28
Tristan Rhodes23-Dec-04 6:28 
GeneralRe: Question about efficiency - Hashtable key types Pin
leppie23-Dec-04 7:42
leppie23-Dec-04 7:42 
GeneralRe: Question about efficiency - Hashtable key types Pin
Tristan Rhodes23-Dec-04 9:57
Tristan Rhodes23-Dec-04 9:57 
GeneralRe: Question about efficiency - Hashtable key types Pin
Matt Gerrans23-Dec-04 11:47
Matt Gerrans23-Dec-04 11:47 
Questionhow to get mirror printing using c# Pin
bigmega23-Dec-04 5:32
bigmega23-Dec-04 5:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.