string length limit in args sent by ISynchronizeInvoke?

  • Thread starter Thread starter Tom Dacon
  • Start date Start date
T

Tom Dacon

I'm raising an event in a component, using ISynchronizeInvoke.Invoke, and my
event args object contains a string as one of its members. If the string is
longer than 63 bytes, the Invoke call pulls an unhandled exception in
System.Windows.Forms.dll, to the effect that the string length must be less
than 64. If I trim the string to 31 characters (62 bytes) everything's fine
and the event goes as intended. But if the string length is 32 or greater,
the unhandled exception gets thrown.

Is there some kind of limit in the marshaling that's going on with Invoke?
Or what? I've looked on groups.google.com but haven't yet stumbled on search
terms that produce any discussion of this. Any ideas?

Thanks,
Tom Dacon
Dacon Software Consulting
 
Sounds like you are trying to set the text of a NotifyIcon which can only have
a small number of characters. This isn't an invoke problem, but rather a
problem
with the underlying API you are calling through invoke.
 
DAMNED good call! That was exactly what was going on.

Thanks for your timely and dead accurate help,
Tom Dacon
Dacon Software Consulting
 
Back
Top