473,508 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3932
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
7359
by: Pankaj Jain | last post by:
Hi All, I have a class A which is derived from ServicesComponent to participate in automatic transaction with falg Transaction.Required. Class A is exposed to client through remoting on Http...
17
2660
by: Hazz | last post by:
In this sample code of ownerdraw drawmode, why does the '(ComboBox) sender' line of code need to be there in this event handler? Isn't cboFont passed via the managed heap, not the stack, into this...
0
1549
by: BobTheHacker | last post by:
I have a c# class library that I call to centralize some code amongst projects. It returns an arraylist back to the calling function that contains class data. Anyway when I call it I can receive it...
3
12947
by: Imran Aziz | last post by:
Hello All, I am getting the following error on our production server, and I dont get the same error on the development box. Unable to cast object of type 'System.Byte' to type 'System.String'. ...
0
1559
by: sam | last post by:
Hi: I am not sure if this is the right place to post this question. Please let me know if it is not and I appreciate if someone could point me in the right direction. I am getting this error...
0
1614
by: hlyall1189 | last post by:
Hi, I recently started upgrading some of my old vs 2003 apps to vs 2005 and used the conversion tool but now i get the following error after building the page. I have typecasted the lines as...
1
3722
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I have a master page and a content page to that master. When I try to work with them I get an inconsistent error of casting ability and it happens irregularly, which means sometimes it can work...
2
10783
by: anj2k5 | last post by:
I uploaded music file in SQl DB in a image dataype .But when i try to reterive it,It doesn't play. It gives the following type casting error on runtime "Unable to cast object of type...
1
16401
by: krishnaneeraja | last post by:
Hi, I wrote code(C#.net) in this way to find ASCII value of an URL.but i got some errors.plz rectify anyone. public int stringorder(string str) { int result=new int; ...
0
7231
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
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7401
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...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4720
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
3196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
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.