473,837 Members | 1,922 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6080
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
25661
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 {System.Array} and the Type is {System.Object}. vSound has no properties or methods that allow you to get access to the byte values. When I type ?vSound
4
12337
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
25686
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 byte,byte, but in vain( It will crash without any exception). Before I saw somebody said he used unsafe code to slove the problem on newsgroup, but without any sample codes.
3
4185
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 an expression of type 'object'. Then, later, I try to use it, and sort on it an get 'cannot convert from 'object' to System.array. what am I doing wrong here?
5
6798
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
25107
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 have tells me what to do, problem is I get the error message "cannot convert `float' to `float*' for argument `1' to `float array_sum(float*, int)' " for line 22 of the program. This is what I have; #include <iostream.h> #include <fstream.h> ...
8
8905
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 webmethod1(object a) where a can be of type string, DateTime, float, etc..
2
6903
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
817
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 IVAN REYES ___________________________________
0
10877
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10570
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10626
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10273
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9402
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7001
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5670
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4474
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 we have to send another system
3
3124
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.