473,385 Members | 1,347 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,385 software developers and data experts.

System.Chart[] when convert to string

Hi,

I am using a DLL file to get a function. This has one parameter which
is a pointer. To access the function I do the following:

---------------------------------------------------------------------------------------------------
[DllImport("statax.dll")]
public static extern unsafe int fnReadMeas(char* buf);

---------------------------------------------------------------------------------------------------
Later on, in a button event I call this function as follows:

---------------------------------------------------------------------------------------------------
int Valor=0;
char[] m_BufMeas=new char[256];
fixed(char* DataRead=m_BufMeas)
{
Valor=fnReadMeas(DataRead);

if(Valor==1)
{
Mylabel.Text=Convert.ToString(m_BufMeas);
break;
}
}
---------------------------------------------------------------------------------------------------
On MyLabel I get the following text "System.Chart[]".
Any tip of how to solve this problem? I should be getting several
numbers in m_BufMeas.

Thanks in advance for your help.

Axel.
Aug 27 '08 #1
1 1170
Axel,

I assume that by System.Chart[], you mean System.Char.

You can pass that array to the constructor of the String class to create
the new string. Use the overload that takes the start index and the length,
in case not all 256 characters are used from the buffer (I assume the return
value of the unmanaged function will indicate the number of characters
written).

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"jadlaxel" <ja******@yahoo.comwrote in message
news:9f**********************************@i76g2000 hsf.googlegroups.com...
Hi,

I am using a DLL file to get a function. This has one parameter which
is a pointer. To access the function I do the following:

---------------------------------------------------------------------------------------------------
[DllImport("statax.dll")]
public static extern unsafe int fnReadMeas(char* buf);

---------------------------------------------------------------------------------------------------
Later on, in a button event I call this function as follows:

---------------------------------------------------------------------------------------------------
int Valor=0;
char[] m_BufMeas=new char[256];
fixed(char* DataRead=m_BufMeas)
{
Valor=fnReadMeas(DataRead);

if(Valor==1)
{
Mylabel.Text=Convert.ToString(m_BufMeas);
break;
}
}
---------------------------------------------------------------------------------------------------
On MyLabel I get the following text "System.Chart[]".
Any tip of how to solve this problem? I should be getting several
numbers in m_BufMeas.

Thanks in advance for your help.

Axel.

Aug 27 '08 #2

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

Similar topics

0
by: TC | last post by:
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl...
3
by: Mahesh Devjibhai Dhola | last post by:
Hi All, I want to make a custom class in c#, which extends System.Xml.XmlNode class of BCL. Now in custom class, I have implement abstract methods of XmlNode class also. Now when I am trying to...
22
by: PeteCresswell | last post by:
I've been to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mschrt/html/vbobjtitleobject.asp, but still don't have a clue. For example, I've got a chart object namde...
3
by: StBond | last post by:
Hi everyone, I am new to Access and Visual Basic so things my be getting across a bit cloudy. I only started using VB for one week. I am having a little problem with the database that I am...
15
by: Yifan | last post by:
Hi Does anybody know how to convert System::String* to char*? I searched the System::String class members and did not find any. Thanks Yifan
5
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of...
3
by: Widge | last post by:
Hi, I've made a piece of VBA that uses a combination of combolists and listboxes to run a query. I just can't think of a way to make this query generate a chart based on its results. Here is my...
5
by: grant | last post by:
I'm trying to use a scatter chart to plot level reading for a pump station level sensor. The sensor takes a reading every 4 seconds, and there are 23,000 reading per chart There appears to be...
1
by: cubekid | last post by:
I am using OWC 11 in my new web application for displaying charts. Is it possible in OWC 11 to combine and display a column and a line graph (Looking like they overlap each other)? I tried it using...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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...

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.