471,309 Members | 1,080 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,309 software developers and data experts.

Unable to cast object of type 'System.Byte[*]' to type 'System.Byte[]


Hi,

I'm working with an ActiveX serial component that fires an event when
data is received. I need to continue to use this component because it
contains the ability to do Xmodem1k an d XmodemCRC comms

The RX even fires and passes an Object (Type: Object) parameter. When
looking @ the Locals window it shows the Type as: Object { byte[] }

<Code>
Byte[] b = (Byte[])e.Data; //(Type Object)
</Code>

System.InvalidCastException: Unable to cast object of type
'System.Byte[*]' to type 'System.Byte[]

I've never seen a System.Byte[*] with an Asterrix before... Google
returns nothing....

Thanks for any help!
Bm
Jun 27 '08 #1
1 3767
mi***********@gmail.com wrote:
Hi,

I'm working with an ActiveX serial component that fires an event when
data is received. I need to continue to use this component because it
contains the ability to do Xmodem1k an d XmodemCRC comms

The RX even fires and passes an Object (Type: Object) parameter. When
looking @ the Locals window it shows the Type as: Object { byte[] }

<Code>
Byte[] b = (Byte[])e.Data; //(Type Object)
</Code>

System.InvalidCastException: Unable to cast object of type
'System.Byte[*]' to type 'System.Byte[]

I've never seen a System.Byte[*] with an Asterrix before... Google
returns nothing....

Thanks for any help!
I'd suggest casting to System.Array (or just using the watch window) and
checking the rank, maybe it's not rank 1.
Bm

Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Pankaj Jain | last post: by
reply views Thread by hlyall1189 | last post: by
1 post views Thread by =?Utf-8?B?RGF2ZQ==?= | last post: by

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.