473,480 Members | 2268 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

string length limit in args sent by ISynchronizeInvoke?

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


Nov 16 '05 #1
2 1943
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.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Tom Dacon" <To**@t-dacons.com> wrote in message
news:Oy**************@tk2msftngp13.phx.gbl...
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

Nov 16 '05 #2
DAMNED good call! That was exactly what was going on.

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

"Justin Rogers" <Ju****@games4dotnet.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
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.

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7936
by: wqhdebian | last post by:
As far as I know,when encrypt or decrypt ,a key must first be got,and the key is first generate by a tool or from SecurityRandom,that means I can not generate the same key with the same input.Does...
5
3253
by: oliver | last post by:
hi there i'm experimanting with imaplib and came across stringts like (\HasNoChildren) "." "INBOX.Sent Items" in which the quotes are part of the string. now i try to convert this into a...
5
128932
by: Wade G. Pemberton | last post by:
Can't find it quickly in the reference books.
8
4713
by: Hal Vaughan | last post by:
Is there a maximum length for Javascript program lines? What about strings? Is there a limit on string length? I found some references that said the maximum string length was 256 characters,...
3
490
by: sjanie | last post by:
The error code is: Microsoft JScript compilation error '800a03ec' Expected ';' /bicc.nl/Connections/BICCwebsite.asp, line 2 Set Conn = Server.CreateObject("ADODB.Connection") ----^
15
1998
by: Andrew Brampton | last post by:
Hi, I'm new to using std classes, but I was wondering how I could do the following efficiently with the string class: Say I had a string with delimited values such as:...
2
5055
by: José Joye | last post by:
Hello, I was wondering if there is a method that exists to replace multi-spaces within a string with single-space. eg: "12 3 4 56" --> "12 3 4 56" I think this could be done by...
33
4632
by: genc_ymeri | last post by:
Hi over there, Propably this subject is discussed over and over several times. I did google it too but I was a little bit surprised what I read on internet when it comes 'when to use what'. Most...
23
9454
by: comp.lang.tcl | last post by:
I have a TCL proc that needs to convert what might be a list into a string to read consider this: ]; # OUTPUTS Hello World which is fine for PHP ]; # OUTPUT {{-Hello}} World, which PHP...
0
7054
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6756
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4495
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3000
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1310
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
570
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.