473,406 Members | 2,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

How to convert 'System::Object __gc *' to 'float array '

Hi guys

I need little help here .
I want to convert 'System::Object __gc * array ' to 'float array'

Lets say I have object Reader with method Send ,it returns a variant
that contains a one-dimensional array of float value .

I m trying to do something like this.

float analogdata[5];

analogdata = Reader->Send ;

When I try this I get following error.
error C2440: '=' : cannot convert from 'System::Object __gc *' to
''float [5]'
Please help me out here :(

thanks

Jun 10 '06 #1
4 6054
On 2006-06-10 23:40, viks wrote:
Hi guys

I need little help here .
I want to convert 'System::Object __gc * array ' to 'float array'

Lets say I have object Reader with method Send ,it returns a variant
that contains a one-dimensional array of float value .

I m trying to do something like this.

float analogdata[5];

analogdata = Reader->Send ;

When I try this I get following error.
error C2440: '=' : cannot convert from 'System::Object __gc *' to
''float [5]'


If I remember correctly you can not assign to an array, nor may you
return an array. You can however assign to a pointer an you can also
return a pointer. In other words try 'flot* analogdata;'.

Erik Wikström
--
"I have always wished for my computer to be as easy to use as my
telephone; my wish has come true because I can no longer figure
out how to use my telephone" -- Bjarne Stroustrup
Jun 10 '06 #2
On 10 Jun 2006 14:40:32 -0700, "viks" <vs******@gmail.com> wrote:
When I try this I get following error.
error C2440: '=' : cannot convert from 'System::Object __gc *' to
''float [5]'


This is not C++ but C++/CLI, the Microsoft hybrid language between C++
and C#. Try to ask in a newsgroup dedicated to C++/CLI.

Jun 11 '06 #3

Roland Pibinger wrote:
On 10 Jun 2006 14:40:32 -0700, "viks" <vs******@gmail.com> wrote:
When I try this I get following error.
error C2440: '=' : cannot convert from 'System::Object __gc *' to
''float [5]'


This is not C++ but C++/CLI, the Microsoft hybrid language between C++
and C#. Try to ask in a newsgroup dedicated to C++/CLI.


who said its not C++ ??

Jun 14 '06 #4
* viks:
Roland Pibinger wrote:
On 10 Jun 2006 14:40:32 -0700, "viks" <vs******@gmail.com> wrote:
When I try this I get following error.
error C2440: '=' : cannot convert from 'System::Object __gc *' to
''float [5]'

This is not C++ but C++/CLI, the Microsoft hybrid language between C++
and C#. Try to ask in a newsgroup dedicated to C++/CLI.


who said its not C++ ??


The error message makes it clear that the context is not C++. While the
question may very well turn out to be pure C++, in such a case it's
usually a waste of time to play detective in order to find some possible
C++ content. So even though your question turned out to actually be
meaningful also in C++ (invalid assignment to array), by including
non-C++ context you've basically cut yourself off from answers from most
C++ experts, and you /do not know/ whether answers based on pure C++ are
valid, because the rules in an extended language may be different.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jun 14 '06 #5

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

Similar topics

1
by: steve | last post by:
I need to get byte values from an object into a byte in order to write the bytes to file. An object (vSound) is passed to a function. From the Autos window I can see that the Value of vSound is...
4
by: Janus Knudsen | last post by:
Hello Im getting an error when I try to convert like this: string arrDSN; objDSN.GetDataSourceList(arrDSN) And the error: Argument '1': cannot convert from 'string' to 'ref System.Array'
1
by: zishen yan | last post by:
Hello, I have a question confused me a long time. I am working on DirectDraw .NET a while. And I want to copy data to surface, but I found Surface.Lock return System.Array. I tried to cast it to...
3
by: klynn | last post by:
I defined a session variable as an array using Session = new string; Later, in my code, I need to set it and sort it. I tried Session = "some string"; My error is "Cannot apply indexing with to...
5
by: tienlx | last post by:
Hi all, I'm have a problem that i don't know how to convert object to char in C# . Does anybody know ? Thanks.
4
by: Pixie Songbook | last post by:
Hi, I'm trying to write a program using the Dev C++ 4.9.9.2 compiler that takes input numbers from a word document, sums them together, and then gives me a result. It should be easy as the book I...
8
by: =?Utf-8?B?UmF2aQ==?= | last post by:
Hi, I'm trying to pass values of different data-types to a web-service. I thought it would be easier to box these values and pass them as a System.object parameter, like public void...
2
by: lisasahu | last post by:
how to convert float to string like there is atof atoi and itoa but is ther any method to convert float to string
2
by: ireyes | last post by:
DEAR SIR, I SAW YOUR INTERNET QUESTION AND I HAVE THE SAME TROUBLE. CUOLD YOU HELP ME TO MAKE A FLOAT TO INTEGER CONVERTION? DO YOU HAVE ANY EXEL FILE THAT CAN DO THAT? REGARDS AND THANKS A LOT ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
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
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...

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.